Send Transactional SMS

You can use this request to send transactional SMSes.

Transactional SMSes allow you to send once-off SMSes to your contacts. These on-demand SMSes are generated in real-time. Transactional SMSes allow you to send a single message to a single contact at a time. For example, if you need to send a one-time pin to a contacts, you can use transactional SMS to do so.

The Method

Transactional SMS only accepts REST calls. It DOES NOT accept XML-RPC calls.
API Method
RESTPOSThttp://[Your URL]/api/2.0/production/sms/message
Your URL is the address of your Everlytic install.

Your method must be structured as follows:

sendSmsMessage($destinationMobile,smsMessageText): String


The following parameters are required:

PropertyTypeDescriptionRequiredAdditional Info
messagestringThe sms message to be sent.yesOnly plain text is accepted. Do not send multimedia.
mobile_numberstringThe mobile number the sms message must be sent to.yesUsing mobile numbers with country code is advised.


A successful call will return HTTP STATUS: 200, and the reason phrase will be: "Your message has been sent."

A possible processing deference will return HTTP STATUS 201.

You can treat any other HTTP STATUS as a failure.

Code Sample



The rest of this document describes the example above, step-by-step.

In our Getting Started section we covered the four important components of an API request; URL, method, headers, and body.


Let's analyse the code sample above to determine where each line fits into this outline.

1. Load the Everlytic API

The following line of code tells the server which API URL to access for the request:

$url = YOUR_EVERLYTIC_INSTALL_URL /api/2.0/production/sms/message';

2. Encode PHP to JSON

The following code tells the API what REST function to use, with a JSON encoding to retrieve the SMS message and mobile number as readable javascript string:

$post = json_encode(['message' => 'Your sms message','mobile_number' => '27711231234']);

3. Authentication

The following code authenticates your username and API key:

$username = 'YOUR_USER_NAME';

$apiKey = 'YOUR_API_KEY';

4. cURL

cURL is a tool for sending and receiving files from a web server. This line of code initialises the cURL session.

$cSession = curl_init();

5. Initiate the Headers

This section of the code opens the headers section, tells the API that the REST function is a JSON object being parsed as a string.

$headers = array(




6. Set various cURL options for the session

curl_setopt($cSession, CURLOPT_URL, $url);

curl_setopt($cSession, CURLOPT_USERPWD, $username . ":" . $apiKey);

curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);

curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, 'POST');

curl_setopt($cSession, CURLOPT_POSTFIELDS, $post);

curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);

7. Output the API response

$result = curl_exec($cSession);

8. Close the cURL session

Translate »