Property | Type | Description | |
---|---|---|---|
$lastRequest | |||
$lastRequestData | |||
$lastRequestInfo |
Property | Type | Description | |
---|---|---|---|
$apiUrl | |||
$authUrl | |||
$clientId | |||
$clientSecret | |||
$responseHeaders | array | [ 'Cache-Control' => 'max-age=0, private, must-revalidate', 'X-RateLimit-Limit' => '600,30000', 'X-RateLimit-Usage' => '4,25', 'Content-Length' => '2031', ... ] Access with the getResponseHeader() or getResponseHeaders() methods. |
Method | Description | |
---|---|---|
__construct ( integer $clientId = 1, string $clientSecret = '' ) | Sets up the class with the $clientId and $clientSecret | |
authenticationUrl ( string $redirect, string $approvalPrompt = 'auto', string $scope = null, string $state = null ) : string | Creates authentication URL for your app | |
deauthorize ( ) : string | Deauthorises application | |
delete ( string $request, array $parameters = [] ) : string | Sends DELETE request to specified API endpoint | |
get ( string $request, array $parameters = [] ) : string | Sends GET request to specified API endpoint | |
getResponseHeader ( string $header ) : string | ||
getResponseHeaders ( ) : array | Returns the complete list of response headers. | |
post ( string $request, array $parameters = [] ) : string | Sends POST request to specified API endpoint | |
put ( string $request, array $parameters = [] ) : string | Sends PUT request to specified API endpoint | |
setAccessToken ( string $token ) : string | Sets the access token used to authenticate API requests | |
tokenExchange ( string $code ) : string | Authenticates token returned from API |
Method | Description | |
---|---|---|
generateParameters ( array $parameters ) : array | Adds access token to paramters sent to API | |
parseGet ( string $url, array $query ) : string | Appends query array onto URL | |
parseHeader ( resource $curl, string $headerLine ) : integer | Parses the header lines into the $responseHeaders attribute | |
parseResponse ( string $response ) : object | Parses JSON as PHP object | |
request ( string $url, array $parameters = [], boolean | string $request = false ) : mixed | Makes HTTP Request to the API |
public __construct ( integer $clientId = 1, string $clientSecret = '' ) | ||
$clientId | integer | |
$clientSecret | string |
protected generateParameters ( array $parameters ) : array | ||
$parameters | array | |
return | array |
public getResponseHeader ( string $header ) : string | ||
$header | string | |
return | string |
public getResponseHeaders ( ) : array | ||
return | array |
protected parseHeader ( resource $curl, string $headerLine ) : integer | ||
$curl | resource | |
$headerLine | string | |
return | integer | length of the currently parsed header line in bytes |
protected parseResponse ( string $response ) : object | ||
$response | string | |
return | object |
public setAccessToken ( string $token ) : string | ||
$token | string | |
return | string |
public tokenExchange ( string $code ) : string | ||
$code | string | |
return | string |
protected array $responseHeaders | ||
return | array |