Twilio API client

package Library
subpackage Twilio
author Aleksey Korzun

 Methods

Twilio seervice onstructor

__construct(string $identifier, string $token, string $version, \Twilio\Client\Client $client) 

Parameters

$identifier

string

account sid

$token

string

OAuth token

$version

string

API version

$client

\Twilio\Client\Client

optional HTTP client

POST to the resource at the specified path.

createData(string $uri, array $parameters) : \Twilio\stdClass | bool

Parameters

$uri

string

uri to the resource

$parameters

string[]

query string parameters

Returns

\Twilio\stdClassbool

DELETE the resource at the specified path.

deleteData(string $uri, array $parameters) : \Twilio\stdClass | bool

Parameters

$uri

string

uri to the resource

$parameters

string[]

query string parameters

Returns

\Twilio\stdClassbool

GET the resource at the specified path.

retrieveData(string $uri, array $parameters, bool $isFullUri) : \Twilio\stdClass | bool

Parameters

$uri

string

uri to the resource

$parameters

string[]

query string parameters

$isFullUri

bool

indicates if passed URI contains full path to the resource

Returns

\Twilio\stdClassbool

Get the API version used by the REST client

version() : string

Returns

stringthe API version in use

Authenticate with API

authenticate() 

Construct a URI based on initial path, query params, and paging information

getRequestUri(string $uri, array $parameters, bool $isFullUri) : string
Static

Parameters

$uri

string

uri to the resource

$parameters

string[]

parameters to use with current request

$isFullUri

bool

indicates if passed URI contains full path to the resource

Returns

string

Process JSON response

processJsonResponse(int $status, string[] $headers, string $body) : \Twilio\stdClass | bool

Parameters

$status

int

response code

$headers

string[]

response headers

$body

string

response body

Exceptions

\Twilio\DomainException
\Twilio\RestException

Returns

\Twilio\stdClassbool

Convert the JSON encoded resource into a PHP object.

processResponse(array $response) : object

Parameters

$response

string[]

3-tuple containing status, headers, and body

Exceptions

\Twilio\DomainException

Returns

objectPHP object decoded from JSON

 Properties

   

$client : object
 

$version : string
 

$versions : string[]

 Constants

 

API end point

API_URI : string
 

User agent requests will identify as

USER_AGENT : string