PHP 클래스 Bitrix24\Bitrix24

저자: Mesilov Maxim ([email protected])
상속: implements Bitrix24\Contracts\iBitrix24
파일 보기 프로젝트 열기: mesilov/bitrix24-php-sdk 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$accessToken access token
$applicationId application id
$applicationScope scope
$applicationSecret application secret
$customCurlOptions custom options for cURL
$domain domain
$isSaveRawResponse if true raw response from bitrix24 will be available from method getRawResponse, this is debug mode
$log PSR-3 compatible logger, use only from wrappers methods log*
$memberId portal GUID
$methodParameters
$rawRequest raw request, contain all cURL options array and API query
$rawResponse raw response from bitrix24
$redirectUri redirect URI from application settings
$refreshToken refresh token
$requestInfo request info data structure акщь curl_getinfo function
$retriesToConnectCount CURL request count retries
$retriesToConnectTimeout retries to connect timeout in microseconds

공개 메소드들

메소드 설명
__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 ( ) : string 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 | null 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 ( integer $microseconds = 1000000 ) : boolean set retries to connect timeout in microseconds

보호된 메소드들

메소드 설명
executeRequest ( string $url, array $additionalParameters = [] ) : array Execute a request API to Bitrix24 using cURL
getErrorContext ( ) : array get error context
handleBitrix24APILevelErrors ( $arRequestResult, $methodName, array $additionalParameters = [] ) : null Handling bitrix24 api-level errors

메소드 상세

__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

call() 공개 메소드

Execute Bitrix24 REST API method
public call ( string $methodName, array $additionalParameters = [] ) : array
$methodName string
$additionalParameters array
리턴 array

executeRequest() 보호된 메소드

Execute a request API to Bitrix24 using cURL
protected executeRequest ( string $url, array $additionalParameters = [] ) : array
$url 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 ( ) : string
리턴 string

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

getErrorContext() 보호된 메소드

get error context
protected getErrorContext ( ) : array
리턴 array

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 | null
리턴 string | null | null

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

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

handleBitrix24APILevelErrors() 보호된 메소드

Handling bitrix24 api-level errors
protected handleBitrix24APILevelErrors ( $arRequestResult, $methodName, array $additionalParameters = [] ) : null
$arRequestResult
$methodName
$additionalParameters array
리턴 null

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 ( integer $microseconds = 1000000 ) : boolean
$microseconds integer
리턴 boolean

프로퍼티 상세

$accessToken 보호되어 있는 프로퍼티

access token
protected $accessToken

$applicationId 보호되어 있는 프로퍼티

application id
protected $applicationId

$applicationScope 보호되어 있는 프로퍼티

scope
protected $applicationScope

$applicationSecret 보호되어 있는 프로퍼티

application secret
protected $applicationSecret

$customCurlOptions 보호되어 있는 프로퍼티

custom options for cURL
protected $customCurlOptions

$domain 보호되어 있는 프로퍼티

domain
protected $domain

$isSaveRawResponse 보호되어 있는 프로퍼티

if true raw response from bitrix24 will be available from method getRawResponse, this is debug mode
protected $isSaveRawResponse

$log 보호되어 있는 프로퍼티

PSR-3 compatible logger, use only from wrappers methods log*
또한 보기: https://github.com/Seldaek/monolog
protected $log

$memberId 보호되어 있는 프로퍼티

portal GUID
protected $memberId

$methodParameters 보호되어 있는 프로퍼티

protected $methodParameters

$rawRequest 보호되어 있는 프로퍼티

raw request, contain all cURL options array and API query
protected $rawRequest

$rawResponse 보호되어 있는 프로퍼티

raw response from bitrix24
protected $rawResponse

$redirectUri 보호되어 있는 프로퍼티

redirect URI from application settings
protected $redirectUri

$refreshToken 보호되어 있는 프로퍼티

refresh token
protected $refreshToken

$requestInfo 보호되어 있는 프로퍼티

request info data structure акщь curl_getinfo function
protected $requestInfo

$retriesToConnectCount 보호되어 있는 프로퍼티

CURL request count retries
protected $retriesToConnectCount

$retriesToConnectTimeout 보호되어 있는 프로퍼티

retries to connect timeout in microseconds
protected $retriesToConnectTimeout