Свойство | 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. |
Méthode | 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. |
Méthode | 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. |
Résultat | array | API response data. |
abstract public applyAccessTokenToRequest ( |
||
$request | HTTP request instance. | |
$accessToken | access token instance. |
public beforeApiRequestSend ( |
||
$event | event instance. |
public createApiRequest ( ) : |
||
Résultat | HTTP request instance. |
protected createSignatureMethod ( array $signatureMethodConfig ) : |
||
$signatureMethodConfig | array | signature method configuration. |
Résultat | signature method instance. |
protected createToken ( array $tokenConfig = [] ) : |
||
$tokenConfig | array | token configuration. |
Résultat | token instance. |
protected defaultReturnUrl ( ) : string | ||
Résultat | string | return URL. |
public getAccessToken ( ) : |
||
Résultat | auth token instance. |
public getSignatureMethod ( ) : |
||
Résultat | signature method instance. |
abstract public refreshAccessToken ( |
||
$token | expired auth token. | |
Résultat | new auth token. |
protected restoreAccessToken ( ) : |
||
Résultat | auth token. |
protected saveAccessToken ( |
||
$token | auth token to be saved. |
protected sendRequest ( |
||
$request | HTTP request to be sent. | |
Résultat | array | response data. |
public setAccessToken ( array | |
||
$token | array | |
access token or its configuration. |
public setReturnUrl ( string $returnUrl ) | ||
$returnUrl | string | return URL |
public setSignatureMethod ( array | |
||
$signatureMethod | array | |
signature method instance or its array configuration. |
public $apiBaseUrl |
public $autoRefreshAccessToken |