All URIs are relative to https://oauth.reddit.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| getAbout() | GET /user/{username}/about | Returns the identity of a user. |
| getSaved() | GET /user/{username}/saved | Get user saved things |
| me() | GET /api/me | Returns the identity of the current user. |
getAbout($username): \Sigwin\RedditClient\Model\UserReturns the identity of a user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Sigwin\RedditClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Sigwin\RedditClient\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$username = snoo; // string
try {
$result = $apiInstance->getAbout($username);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->getAbout: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | string |
\Sigwin\RedditClient\Model\User
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getSaved($username, $after, $before, $limit): \Sigwin\RedditClient\Model\ListingEnvelopeGet user saved things
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Sigwin\RedditClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Sigwin\RedditClient\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$username = snoo; // string
$after = 'after_example'; // string
$before = 'before_example'; // string
$limit = 25; // int
try {
$result = $apiInstance->getSaved($username, $after, $before, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->getSaved: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | string | ||
| after | string | [optional] | |
| before | string | [optional] | |
| limit | int | [optional] [default to 25] |
\Sigwin\RedditClient\Model\ListingEnvelope
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
me(): \Sigwin\RedditClient\Model\UserDataReturns the identity of the current user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Sigwin\RedditClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Sigwin\RedditClient\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->me();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->me: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\Sigwin\RedditClient\Model\UserData
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]