Documentation

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

$_appVersion

protected string $_appVersion

$_clientSecret

protected string $_clientSecret

$_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 = ''

authUrl()

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
string

createUrl()

public createUrl([string $path = '' ][, array<string|int, mixed> $options = [] ]) : string
Parameters
$path : string = ''
$options : array<string|int, mixed> = []
Return values
string

delete()

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
throws
Exception

If an error occurs parsing the response from the request.

ApiException

If an error occurs making the request.

Return values
ApiResponse

get()

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
throws
Exception

If an error occurs parsing the response from the request.

ApiException

If an error occurs making the request.

Return values
ApiResponse

inflateRequest()

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
throws
Exception

If an error occurs parsing the response from the refresh request.

ApiException

If an error occurs making the refresh request.

Return values
RequestInterface

loggedIn()

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
throws
Exception

If it fails to retrieve/parse JSON data from he response.

ApiException

If there is an issue with the token request.

Return values
ApiResponse

parseAuthRedirectUrl()

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
throws
Exception

If an error occurs parsing the response from the request.

ApiException

If an error occurs making the request.

Return values
ApiResponse

post()

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
throws
Exception

If an error occurs parsing the response from the request.

ApiException

If an error occurs making the request.

Return values
ApiResponse

put()

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
throws
Exception

If an error occurs parsing the response from the request.

ApiException

If an error occurs making the request.

Return values
ApiResponse

refresh()

Request new tokens using the existing refresh token or the client credentials grant.

public refresh() : ApiResponse
Tags
throws
Exception

If it fails to retrieve/parse JSON data from he response.

ApiException

If the existing refresh token is invalid or there is an issue with the request.

Return values
ApiResponse

sendRequest()

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
throws
Exception

If an error occurs parsing the response from the refresh request as part of inflateRequest()

ApiException

If an error occurs making the refresh request as part of inflateRequest()

Return values
ApiResponse

apiKey()

protected apiKey() : string
Return values
string

authHeader()

protected authHeader() : string
Return values
string

ensureAuthentication()

protected ensureAuthentication() : void
Tags
throws
Exception

If an error occurs parsing the response from the refresh request.

ApiException

If an error occurs making the refresh request.

requestToken()

protected requestToken([string $path = '' ][, array<string|int, mixed> $body = [] ]) : ApiResponse
Parameters
$path : string = ''
$body : array<string|int, mixed> = []
Tags
throws
Exception

If an error occurs parsing the response from the request.

ApiException

If an error occurs making the request.

Return values
ApiResponse

requestClientCredentialsToken()

private requestClientCredentialsToken() : mixed
On this page

Search results