\Aculab\WebServicesWrapperMessageWebService

Message management web service.

Summary

Methods
Properties
Constants
setWebServicesServer()
setCryptoMethod()
setProxy()
__construct()
sendMessage()
cancelMessage()
messageStatus()
listBlockedTo()
listBlockedFrom()
No public properties found
VERSION
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

VERSION

VERSION

The wrapper version.

The wrapper version number.

Methods

setWebServicesServer()

setWebServicesServer(string  $wsserver) 

Set the web services server address.

This allows the web service requests to be directed to a specific server. The default is https://ws-<cloud_id>.aculabcloud.net

Parameters

string $wsserver

The base URL of the web services server.

setCryptoMethod()

setCryptoMethod(integer  $method) 

Set the crypto method used when connectiing to the web services server.

This allows a specific crypto method to be used when connecting to the web service server. The values should be one of the STREAM_CRYPTO_METHOD_TLSv1_N_CLIENT constants. The default is STREAM_CRYPTO_METHOD_ANY_CLIENT.

Parameters

integer $method

The crypto method to use.

setProxy()

setProxy(string  $proxy, boolean  $request_fulluri) 

Configures the proxy server to use when making Web Service requests.

Parameters

string $proxy

URI specifying address of proxy server. (e.g. tcp://proxy.example.com:5100).

boolean $request_fulluri

When set to TRUE, the entire URI will be used when constructing the request. While this is a non-standard request format, some proxy servers require it.

__construct()

__construct(string  $cloud_id, string  $username, string  $access_key) 

Create a MessageWebService object.

Parameters

string $cloud_id

The cloud identifier, such as "1-2-0".

string $username

The cloud account username.

string $access_key

The access key for the cloud account.

sendMessage()

sendMessage(\Aculab\WebServicesWrapper\Message  $message) : array

Send an SMS/MMS message.

This queues an outbound SMS/MMS message for sending.

Parameters

\Aculab\WebServicesWrapper\Message $message

The message to queue for sending.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

Returns an array of one or more unique message reference ID strings.

If your content was short enough to fit into a single message then this will return a single reference ID. Otherwise, your message will have been split into two or more separate message parts, and a reference ID string will be returned for each one.

cancelMessage()

cancelMessage(array|string  $message_ids) : array

Cancel a queued SMS/MMS message.

This attempts to cancel one or more messages that have been queued for sending. Once a message has been taken off the queue to be sent, it cannot be cancelled. To cancel a message which was split into two or more underlying messages, you need supply only one of its message_refs and, if all its underlying messages are queued, they will be cancelled.

Parameters

array|string $message_ids

An array of message IDs or a single message ID.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

Returns an array, keyed by message ID, containing the cancellation status, The cancellation status is one of "success", "unknown", or "failed".

"success" indicates that the message has been cancelled. "failed" indicates that the message reference was recognised but its message couldn't be cancelled, generally because it has already been sent. "unknown" indicates that the message reference was not recognised, either because it was incorrect or has expired.

messageStatus()

messageStatus(array|string  $message_ids) : array

Get the status of an SMS/MMS message.

This retrieves the status of one or more messages given their message reference IDs.

Parameters

array|string $message_ids

An array of message IDs or a single message ID.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

Returns an array of MessageStatus objects, keyed by message ID.

listBlockedTo()

listBlockedTo(string  $to) : array

Get numbers blocked from sending to a number.

This lists all your numbers which are blocked for sending to this number.

Parameters

string $to

A mobile number.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

Returns an array of MessageBlockedDetails objects.

listBlockedFrom()

listBlockedFrom(string  $from) : array

Get numbers blocked from receiving from a number.

This lists all mobile numbers which the $from number is blocked for sending to.

Parameters

string $from

One of your numbers.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

Returns an array of MessageBlockedDetails objects.