Property | Type | Description | |
---|---|---|---|
$apiBaseUrl | API base URL. This field will be used as [[\yii\httpclient\Client::baseUrl]] value of [[httpClient]]. Note: changing this property will take no effect after [[httpClient]] is instantiated. | ||
$authUrl | authorize URL. | ||
$autoRefreshAccessToken | whether to automatically perform 'refresh access token' request on expired access token. | ||
$scope | auth request scope. | ||
$version | protocol version. |
Method | Description | |
---|---|---|
api ( string $apiSubUrl, string $method = 'GET', array | string $data = [], array $headers = [] ) : array | Performs request to the OAuth API returning response data. | |
applyAccessTokenToRequest ( |
Applies access token to the HTTP request instance. | |
beforeApiRequestSend ( |
Handles [[Request::EVENT_BEFORE_SEND]] event. | |
createApiRequest ( ) : |
Creates an HTTP request for the API call. | |
getAccessToken ( ) : |
||
getReturnUrl ( ) : string | ||
getSignatureMethod ( ) : |
||
refreshAccessToken ( |
Gets new auth token to replace expired one. | |
setAccessToken ( array | |
Sets access token to be used. | |
setHttpClient ( $httpClient ) | ||
setReturnUrl ( string $returnUrl ) | ||
setSignatureMethod ( array | |
Set signature method to be used. |
Method | Description | |
---|---|---|
composeUrl ( string $url, array $params = [] ) : string | Composes URL from base URL and GET params. | |
createHttpClient ( $reference ) | ||
createSignatureMethod ( array $signatureMethodConfig ) : |
Creates signature method instance from its configuration. | |
createToken ( array $tokenConfig = [] ) : |
Creates token from its configuration. | |
defaultRequestOptions ( ) | ||
defaultReturnUrl ( ) : string | Composes default [[returnUrl]] value. | |
restoreAccessToken ( ) : |
Restores access token. | |
saveAccessToken ( |
Saves token as persistent state. | |
sendRequest ( |
Sends the given HTTP request, returning response data. |
public api ( string $apiSubUrl, string $method = 'GET', array | string $data = [], array $headers = [] ) : array | ||
$apiSubUrl | string | API sub URL, which will be append to [[apiBaseUrl]], or absolute API URL. |
$method | string | request method. |
$data | array | string | request data or content. |
$headers | array | additional request headers. |
return | array | API response data. |
abstract public applyAccessTokenToRequest ( |
||
$request | HTTP request instance. | |
$accessToken | access token instance. |
public beforeApiRequestSend ( |
||
$event | event instance. |
public createApiRequest ( ) : |
||
return | HTTP request instance. |
protected createSignatureMethod ( array $signatureMethodConfig ) : |
||
$signatureMethodConfig | array | signature method configuration. |
return | signature method instance. |
protected createToken ( array $tokenConfig = [] ) : |
||
$tokenConfig | array | token configuration. |
return | token instance. |
protected defaultReturnUrl ( ) : string | ||
return | string | return URL. |
public getAccessToken ( ) : |
||
return | auth token instance. |
public getSignatureMethod ( ) : |
||
return | signature method instance. |
abstract public refreshAccessToken ( |
||
$token | expired auth token. | |
return | new auth token. |
protected restoreAccessToken ( ) : |
||
return | auth token. |
protected saveAccessToken ( |
||
$token | auth token to be saved. |
protected sendRequest ( |
||
$request | HTTP request to be sent. | |
return | array | response data. |
public setAccessToken ( array | |
||
$token | array | |
access token or its configuration. |
public setSignatureMethod ( array | |
||
$signatureMethod | array | |
signature method instance or its array configuration. |
public $apiBaseUrl |
public $autoRefreshAccessToken |