\OctopushClient

The client for Octopush request API

Summary

Methods
Properties
Constants
__construct()
send()
request()
buildQuery()
getUrl()
setResponse()
getResponse()
getErrors()
decode()
No public properties found
No constants found
setErrors()
$url
$login
$apiKey
$port
$response
$errors
N/A
No private methods found
No private properties found
N/A

Properties

$url

$url : string

Url API SMS HTTP(S)

Type

string

$login

$login : string

Login identifier

Type

string

$apiKey

$apiKey : string

Api key

Type

string

$port

$port : integer

HTTP port

Type

integer

$response

$response : array

Api Response

Type

array

$errors

$errors : array

The API errors

Type

array

Methods

__construct()

__construct(string  $login, string  $key, integer  $port = 443) : void

Create a new sms client

Parameters

string $login

The Octopush login email

string $key

The Octopush api key

integer $port

The HTTP Port to determine scheme url

send()

send(string  $message, array  $options = array()) : boolean

Send a sms message

Parameters

string $message

The string message

array $options

The array options

Returns

boolean —

true if message is send otherwise false

request()

request(string  $url, array  $params = array()) : \Octopush\Client

Send a curl request

Parameters

string $url

The url API

array $params

The query params

Returns

\Octopush\Client

buildQuery()

buildQuery(array  $params = array()) : string

Merge the credentials and params then returns the string query

Parameters

array $params

The params array

Returns

string —

The query string

getUrl()

getUrl() : string

Returns the formatted url with http scheme for port 80 or https for port 443

Returns

string —

The formatted url

setResponse()

setResponse(string  $response) 

Sets and encode the respoponse xml to php array

Parameters

string $response

The xml response string

getResponse()

getResponse() : array

Returns the response

Returns

array —

the curl response

getErrors()

getErrors() : array

Returns the array errors

Returns

array

decode()

decode(string  $response) : array

Decode Curl Response xml to php stdClass

Parameters

string $response

The xml response returns by curl request

Returns

array

setErrors()

setErrors(string  $response) : \Octopush\Client

Set the xml errors

Parameters

string $response

Returns

\Octopush\Client