Copied!
Cloneable Instantiable
Properties
public string $accessToken
public string $refreshToken
Methods
public __construct ( string $clientAPIKey , string $clientSecret , string $redirectURI = 'https://localhost/' )
 

Construct a client.

By default, all scopes are enabled. You can remove any, or
set new ones.

public acquireAccessToken ( string $code ) : bool
 

Exchange an authorization code for an access token.

Make this call by passing in the code present when the account owner is redirected back to you.
The response will contain an 'access_token' and 'refresh_token'

  • param string $code - Authorization Code
public addScope ( string $scope ) : self
public delete ( string $url ) : bool
public get ( string $url , array $parameters ) : array
public getAuthorizationURL () : string
 

Generate the URL an account owner would use to allow your app
to access their account.

After visiting the URL, the account owner is prompted to log in and allow your app to access their account.
They are then redirected to your redirect URL with the authorization code appended as a query parameter. e.g.:
http://localhost:8888/?code={authorization_code}

public getBody () : string
public getLastError () : string
public getStatusCode () : int
public next () : array
public patch ( string $url , array $parameters ) : array
public post ( string $url , array $parameters ) : array
public put ( string $url , array $parameters , string $method = 'PUT' ) : array
public refreshToken () : string
 

Refresh the access token.

  • return string new access token or 'Error' for error
public removeScope ( string $scope ) : self
public setHost ( string $host ) : self
public setScopes ( array $scopes ) : self
Properties
private string $body
private string $clientAPIKey
private string $clientSecret
private string $host
private string $lastError
private string $next
private string $oauth2URL
private string $redirectURI
private array $scopes
private int $statusCode
private array $validScopes
Methods
private exec ( CurlHandle $ch ) : bool
private getHeaders ( array $additional = [ ] ) : array
private process ( GuzzleHttp\Psr7\Response $response ) : array
private setAuthorization ( CurlHandle $ch ) : void
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration