Platform
in package
Table of Contents
Constants
- ACCESS_TOKEN_TTL : mixed = 3600
- API_VERSION : mixed = 'v1.0'
- AUTHORIZE_ENDPOINT : mixed = '/restapi/oauth/authorize'
- KNOWN_PREFIXES : mixed = array(self::URL_PREFIX, '/rcvideo', '/video', '...
- REFRESH_TOKEN_TTL : mixed = 604800
- REVOKE_ENDPOINT : mixed = '/restapi/oauth/revoke'
- TOKEN_ENDPOINT : mixed = '/restapi/oauth/token'
- URL_PREFIX : mixed = '/restapi'
Properties
- $_appName : string
- $_appVersion : string
- $_auth : Auth
- $_client : Client
- $_clientId : string
- $_clientSecret : string
- $_server : string
- $_userAgent : string
Methods
- __construct() : mixed
- Platform constructor.
- auth() : Auth
- authUrl() : string
- Create and return a URL that can be used for authenticating/logging in to RingCentral.
- createUrl() : string
- delete() : ApiResponse
- get() : ApiResponse
- inflateRequest() : RequestInterface
- Convenience helper used for processing requests (even externally created).
- loggedIn() : bool
- Checks the access token and attempts to renew it when it has expired.
- login() : ApiResponse
- Pass an empty options array to authenticate using the SDK's client ID and secret.
- logout() : ApiResponse
- parseAuthRedirectUrl() : array<string|int, mixed>
- patch() : ApiResponse
- post() : ApiResponse
- put() : ApiResponse
- refresh() : ApiResponse
- Request new tokens using the existing refresh token or the client credentials grant.
- sendRequest() : ApiResponse
- Method sends the request (even externally created) to API server using client
- apiKey() : string
- authHeader() : string
- ensureAuthentication() : void
- requestToken() : ApiResponse
- requestClientCredentialsToken() : mixed
Constants
ACCESS_TOKEN_TTL
public
mixed
ACCESS_TOKEN_TTL
= 3600
API_VERSION
public
mixed
API_VERSION
= 'v1.0'
AUTHORIZE_ENDPOINT
public
mixed
AUTHORIZE_ENDPOINT
= '/restapi/oauth/authorize'
KNOWN_PREFIXES
public
mixed
KNOWN_PREFIXES
= array(self::URL_PREFIX, '/rcvideo', '/video', '/webinar', '/team-messaging', '/analytics', '/ai', '/scim', '/cx')
REFRESH_TOKEN_TTL
public
mixed
REFRESH_TOKEN_TTL
= 604800
REVOKE_ENDPOINT
public
mixed
REVOKE_ENDPOINT
= '/restapi/oauth/revoke'
TOKEN_ENDPOINT
public
mixed
TOKEN_ENDPOINT
= '/restapi/oauth/token'
URL_PREFIX
public
mixed
URL_PREFIX
= '/restapi'
Properties
$_appName
protected
string
$_appName
$_appVersion
protected
string
$_appVersion
$_auth
protected
Auth
$_auth
$_client
protected
Client
$_client
$_clientId
protected
string
$_clientId
$_clientSecret
protected
string
$_clientSecret
$_server
protected
string
$_server
$_userAgent
protected
string
$_userAgent
Methods
__construct()
Platform constructor.
public
__construct(Client $client, string $clientId, string $clientSecret, string $server[, string $appName = '' ][, string $appVersion = '' ]) : mixed
Parameters
- $client : Client
- $clientId : string
- $clientSecret : string
- $server : string
- $appName : string = ''
- $appVersion : string = ''
auth()
public
auth() : Auth
Return values
AuthauthUrl()
Create and return a URL that can be used for authenticating/logging in to RingCentral.
public
authUrl(array<string|int, mixed> $options) : string
Parameters
- $options : array<string|int, mixed>
-
An array containing information that will be added to the generated URL. $options = [ 'redirectUri' => (string) The callback URI to use once authentication is complete. 'state' => (string) 'brandId' => (string) 'display' => (string) 'prompt' => (string) 'code_challenge' => (string) Used to facilitate PKCE auth flows 'code_challenge_method' => (string) Used to facilitate PKCE auth flows ]
Return values
stringcreateUrl()
public
createUrl([string $path = '' ][, array<string|int, mixed> $options = [] ]) : string
Parameters
- $path : string = ''
- $options : array<string|int, mixed> = []
Return values
stringdelete()
public
delete([string $url = '' ][, mixed $body = null ][, array<string|int, mixed> $queryParameters = [] ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $options = [] ]) : ApiResponse
Parameters
- $url : string = ''
- $body : mixed = null
- $queryParameters : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
Tags
Return values
ApiResponseget()
public
get([string $url = '' ][, array<string|int, mixed> $queryParameters = [] ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $options = [] ]) : ApiResponse
Parameters
- $url : string = ''
- $queryParameters : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
Tags
Return values
ApiResponseinflateRequest()
Convenience helper used for processing requests (even externally created).
public
inflateRequest(RequestInterface $request[, array<string|int, mixed> $options = [] ]) : RequestInterface
Performs access token refresh if needed. Then adds Authorization header and API server to URI
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed> = []
Tags
Return values
RequestInterfaceloggedIn()
Checks the access token and attempts to renew it when it has expired.
public
loggedIn() : bool
Return values
bool —True if the access token is valid or can be renewed.
login()
Pass an empty options array to authenticate using the SDK's client ID and secret.
public
login(array<string|int, mixed>|string $options) : ApiResponse
Parameters
- $options : array<string|int, mixed>|string
-
Login options or the username for legacy password login.
Tags
Return values
ApiResponselogout()
public
logout() : ApiResponse
Tags
Return values
ApiResponseparseAuthRedirectUrl()
public
parseAuthRedirectUrl(string $url) : array<string|int, mixed>
Parameters
- $url : string
Return values
array<string|int, mixed>patch()
public
patch([string $url = '' ][, array<string|int, mixed> $body = null ][, array<string|int, mixed> $queryParameters = [] ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $options = [] ]) : ApiResponse
Parameters
- $url : string = ''
- $body : array<string|int, mixed> = null
- $queryParameters : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
Tags
Return values
ApiResponsepost()
public
post([string $url = '' ][, array<string|int, mixed> $body = null ][, array<string|int, mixed> $queryParameters = [] ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $options = [] ]) : ApiResponse
Parameters
- $url : string = ''
- $body : array<string|int, mixed> = null
- $queryParameters : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
Tags
Return values
ApiResponseput()
public
put([string $url = '' ][, array<string|int, mixed> $body = null ][, array<string|int, mixed> $queryParameters = [] ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $options = [] ]) : ApiResponse
Parameters
- $url : string = ''
- $body : array<string|int, mixed> = null
- $queryParameters : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
Tags
Return values
ApiResponserefresh()
Request new tokens using the existing refresh token or the client credentials grant.
public
refresh() : ApiResponse
Tags
Return values
ApiResponsesendRequest()
Method sends the request (even externally created) to API server using client
public
sendRequest(RequestInterface $request[, array<string|int, mixed> $options = [] ]) : ApiResponse
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed> = []
Tags
Return values
ApiResponseapiKey()
protected
apiKey() : string
Return values
stringauthHeader()
protected
authHeader() : string
Return values
stringensureAuthentication()
protected
ensureAuthentication() : void
Tags
requestToken()
protected
requestToken([string $path = '' ][, array<string|int, mixed> $body = [] ]) : ApiResponse
Parameters
- $path : string = ''
- $body : array<string|int, mixed> = []
Tags
Return values
ApiResponserequestClientCredentialsToken()
private
requestClientCredentialsToken() : mixed