PHP Интерфейс Bitrix24\Contracts\iBitrix24

Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( boolean $isSaveRawResponse = false, Psr\Log\LoggerInterface $obLogger = null ) : Bitrix24 Create a object to work with Bitrix24 REST API service
call ( string $methodName, array $additionalParameters = [] ) : array Execute Bitrix24 REST API method
getAccessToken ( ) : string | null Get access token
getApplicationId ( ) : string Get application id
getApplicationScope ( ) Get application scope
getApplicationSecret ( ) : string Get application secret
getAvailableMethods ( array $applicationScope = [], boolean $isFull = false ) : array Get list of all methods available for current application
getDomain ( ) : string | null Get domain
getFirstAccessToken ( $code ) : array Authorize and get first access token
getMemberId ( ) : string | null Get memeber ID
getMethodParameters ( ) : array | null Return additional parameters of last api-call. Data available after you try to call method call
getNewAccessToken ( ) : array Get new access token
getRawRequest ( ) : array | null Return raw request, contain all cURL options array and API query. Data available after you try to call method call numbers of array keys is const of cURL module. Example: CURLOPT_RETURNTRANSFER = 19913
getRawResponse ( ) : string Get raw response from Bitrix24 before json_decode call, method available only in debug mode.
getRedirectUri ( ) : string | null Get redirect URI
getRefreshToken ( ) : string Get refresh token
getRequestInfo ( ) : array | null Return result from function curl_getinfo. Data available after you try to call method call
getRetriesToConnectCount ( ) : integer get CURL request count retries
getRetriesToConnectTimeout ( ) : mixed get retries to connect timeout in microseconds
getScope ( boolean $isFull = false ) : array get list of scope for current application from bitrix24 api
getSecuritySignSalt ( ) : integer Get a random string to sign protected api-call. Use salt for argument "state" in secure api-call random string is a result of mt_rand function
isAccessTokenExpire ( ) : boolean Check is access token expire, call list of all available api-methods from B24 portal with current access token if we have an error code expired_token then return true else return false
setAccessToken ( string $accessToken ) : true; Set access token
setApplicationId ( string $applicationId ) : true; Set application id
setApplicationScope ( array $applicationScope ) : boolean Set application scope
setApplicationSecret ( string $applicationSecret ) : true; Set application secret
setCustomCurlOptions ( array $options ) : boolean Set custom cURL options, overriding default ones
setDomain ( $domain ) : true; Set domain
setMemberId ( string $memberId ) : true; Set member ID — portal GUID
setRedirectUri ( string $redirectUri ) : true; Set redirect URI
setRefreshToken ( $refreshToken ) : true; Set refresh token
setRetriesToConnectCount ( $retriesCnt = 1 ) : boolean set CURL request count retries
setRetriesToConnectTimeout ( $microseconds = 1000000 ) : boolean set retries to connect timeout in microseconds

Описание методов

__construct() публичный Метод

Create a object to work with Bitrix24 REST API service
public __construct ( boolean $isSaveRawResponse = false, Psr\Log\LoggerInterface $obLogger = null ) : Bitrix24
$isSaveRawResponse boolean - if true raw response from bitrix24 will be available from method getRawResponse, this is debug mode
$obLogger Psr\Log\LoggerInterface - instance of \Monolog\Logger
Результат Bitrix24\Bitrix24

call() публичный Метод

Execute Bitrix24 REST API method
public call ( string $methodName, array $additionalParameters = [] ) : array
$methodName string
$additionalParameters array
Результат array

getAccessToken() публичный Метод

Get access token
public getAccessToken ( ) : string | null
Результат string | null | null

getApplicationId() публичный Метод

Get application id
public getApplicationId ( ) : string
Результат string

getApplicationScope() публичный Метод

Get application scope
public getApplicationScope ( )

getApplicationSecret() публичный Метод

Get application secret
public getApplicationSecret ( ) : string
Результат string

getAvailableMethods() публичный Метод

Get list of all methods available for current application
public getAvailableMethods ( array $applicationScope = [], boolean $isFull = false ) : array
$applicationScope array
$isFull boolean
Результат array

getDomain() публичный Метод

Get domain
public getDomain ( ) : string | null
Результат string | null | null

getFirstAccessToken() публичный Метод

Authorize and get first access token
public getFirstAccessToken ( $code ) : array
$code
Результат array

getMemberId() публичный Метод

Get memeber ID
public getMemberId ( ) : string | null
Результат string | null | null

getMethodParameters() публичный Метод

Return additional parameters of last api-call. Data available after you try to call method call
public getMethodParameters ( ) : array | null
Результат array | null | null

getNewAccessToken() публичный Метод

Get new access token
public getNewAccessToken ( ) : array
Результат array

getRawRequest() публичный Метод

Return raw request, contain all cURL options array and API query. Data available after you try to call method call numbers of array keys is const of cURL module. Example: CURLOPT_RETURNTRANSFER = 19913
public getRawRequest ( ) : array | null
Результат array | null | null

getRawResponse() публичный Метод

To activate debug mode you must before set to true flag isSaveRawResponse in class construct
public getRawResponse ( ) : string
Результат string

getRedirectUri() публичный Метод

Get redirect URI
public getRedirectUri ( ) : string | null
Результат string | null | null

getRefreshToken() публичный Метод

Get refresh token
public getRefreshToken ( ) : string
Результат string

getRequestInfo() публичный Метод

Return result from function curl_getinfo. Data available after you try to call method call
public getRequestInfo ( ) : array | null
Результат array | null | null

getRetriesToConnectCount() публичный Метод

get CURL request count retries
public getRetriesToConnectCount ( ) : integer
Результат integer

getRetriesToConnectTimeout() публичный Метод

get retries to connect timeout in microseconds
public getRetriesToConnectTimeout ( ) : mixed
Результат mixed

getScope() публичный Метод

get list of scope for current application from bitrix24 api
public getScope ( boolean $isFull = false ) : array
$isFull boolean
Результат array

getSecuritySignSalt() публичный Метод

Get a random string to sign protected api-call. Use salt for argument "state" in secure api-call random string is a result of mt_rand function
public getSecuritySignSalt ( ) : integer
Результат integer

isAccessTokenExpire() публичный Метод

Check is access token expire, call list of all available api-methods from B24 portal with current access token if we have an error code expired_token then return true else return false
public isAccessTokenExpire ( ) : boolean
Результат boolean

setAccessToken() публичный Метод

Set access token
public setAccessToken ( string $accessToken ) : true;
$accessToken string
Результат true;

setApplicationId() публичный Метод

Set application id
public setApplicationId ( string $applicationId ) : true;
$applicationId string
Результат true;

setApplicationScope() публичный Метод

Set application scope
public setApplicationScope ( array $applicationScope ) : boolean
$applicationScope array
Результат boolean

setApplicationSecret() публичный Метод

Set application secret
public setApplicationSecret ( string $applicationSecret ) : true;
$applicationSecret string
Результат true;

setCustomCurlOptions() публичный Метод

Set custom cURL options, overriding default ones
public setCustomCurlOptions ( array $options ) : boolean
$options array - array(CURLOPT_XXX => value1, CURLOPT_XXX2 => value2,...)
Результат boolean

setDomain() публичный Метод

Set domain
public setDomain ( $domain ) : true;
$domain
Результат true;

setMemberId() публичный Метод

Set member ID — portal GUID
public setMemberId ( string $memberId ) : true;
$memberId string
Результат true;

setRedirectUri() публичный Метод

Set redirect URI
public setRedirectUri ( string $redirectUri ) : true;
$redirectUri string
Результат true;

setRefreshToken() публичный Метод

Set refresh token
public setRefreshToken ( $refreshToken ) : true;
$refreshToken
Результат true;

setRetriesToConnectCount() публичный Метод

set CURL request count retries
public setRetriesToConnectCount ( $retriesCnt = 1 ) : boolean
$retriesCnt
Результат boolean

setRetriesToConnectTimeout() публичный Метод

set retries to connect timeout in microseconds
public setRetriesToConnectTimeout ( $microseconds = 1000000 ) : boolean
$microseconds
Результат boolean