Send SMS

This call allows you to send SMS to one or multiple destinations.

Definition

http:// or https:// www.voodooSMS.com/vapi/server/sendSMS

Methods

Parameters

Required Fields

dest: Format: 447700900000 (where 44 is country code e.g. 44 is UK). Multiple destinations can be separated with commas e.g. 447700900000,447700777888. When numbers presented are not in the correct country code format, use the ‘cc’ parameter to correct the country code formatting.You can also send a message to all numbers within’ a contact list.To do this, instead of adding numbers to the dest= parameter, use the format c1234 where 1234 is the ID of the contact list with the numbers in you wish to message
orig: Maximum of 15 Numeric Digits or 11 alphanumeric (a-z, A-Z, 0-9 only) (The Sender ID is who the message appears from. A Sender ID must be greater than 4 characters. You can use up to 11 alphanumeric characters. Please note that some networks accept spaces whilst others do not and will remove them. Using the number ‘3’ in a Sender ID requires registration - please contact your Account Manager to discuss this.)
msg: Up to 160 for standard length message (per SMS Credit), between 160 and 918 characters for long messages. Special characters to be URL Encoded (%xx where xx is ASCII Hex value for character, e.g. %20 for space or + can be used for a space). See the URL Encoding section later on in this document.
uid: System allocated username for API user configured within the VoodooSMS.com Portal in ‘Send SMS>API Management’
pass: System password for API user configured within the VoodooSMS.com Portal in ‘Send SMS>API Management’
validity: 1 (always)
format: Return format requested: XML, JSON or PHP data.

Optional Parameters

cc: Check & reformat destination number feature This is an optional field, if you choose to specify the country code in the sendSMS API Call, e.g. 44 and the API will check that the specified destination number Examples
If dest=447700900000 and cc=44 - no change will be made.
 If dest=07700900000 and cc=44 - dest will be changed to 447700900000
If dest=7700900000 and cc=44 - dest will be changed to 447700900000
sd: Maximum of 15 Numeric Digits or 11 alphanumeric (a-z, A-Z, 0-9 only) (The Sender ID is who the message appears from. A Sender ID must be greater than 4 characters. You can use up to 11 alphanumeric characters. Please note that some networks accept spaces whilst others do not and will remove them. Using the number ‘3’ in a Sender ID requires registration - please contact your Account Manager to discuss this.)
tz: By default our API uses the UTC (Coordinated Universal Time). If you want to make an API call different to UTC then simply add, or subtract the time from UTC. e.g. for Melbourne, Australia is UTC+11 so the API call would be &tz=+11
autolist: Specify the id of the Auto Contact List e.g. autolist=1 See the Auto List Section later in the document for an explanation of this feature.
tc: System password for API user configured within the VoodooSMS.com Portal in ‘Send SMS>API Management’
qt: Quiet Times - If qt=1 is specified in the API call, then the platform will check if Quiet Times is enabled for the specified API credentials used, and if so use the API Quiet Times configuration (Account -> Quiet Times) to check that the SMS can be sent at the current time and day. If the current day and time falls outside of the existing Quiet Times configuration, the SMS will not be sent until the current quiet time period has ended.
eref: External Reference - This allows you to specify your own reference value which will be stored within the platform, up to 30 characters in length. This, in conjunction with the getDLRer API call which will also specify the er value supplied.

Single textual message to single destinations

Request

<?php
switch($_SERVER["REQUEST_METHOD"]) {
    case "GET":
        $uid = htmlspecialchars($_GET["uid"]);
        $pass = htmlspecialchars($_GET["pass"]);
        $dest = htmlspecialchars($_GET["dest"]);
        $orig = htmlspecialchars($_GET["orig"]);
        $msg = htmlspecialchars($_GET["msg"]);
        $format = htmlspecialchars($_GET["format"]);
        break;
    case "POST":
        $uid = htmlspecialchars($_POST["uid"]);
        $pass = htmlspecialchars($_POST["pass"]);
        $dest = htmlspecialchars($_POST["dest"]);
        $orig = htmlspecialchars($_POST["orig"]);
        $msg = htmlspecialchars($_POST["msg"]);
        $format = htmlspecialchars($_POST["format"]);
        break;
}

$url = 'https://www.voodoosms.com/vapi/server/sendSMS?uid='.$uid.'&pass='.$pass.
        '&dest='.$dest.'&orig='.$orig."&msg=".$msg."&format=".$format;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
// Download the given URL, and return output
$output = curl_exec($ch);
echo $output . "   " . curl_error($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
?>

Response

<xml>
   <result>200</result>
   <resultText>200 OK</resultText>
   <reference_id>
      <item>ss3SliH1ZvlxQtv07262607171vapi</item>
   </reference_id>
</xml>

On success, the response header HTTP status code will be 200 OK confirming that the message is sent. If you try to send message without authorisation you an error code of 401 Unauthorized will be received.

SMS Response Details

Parameter Type Description
result int 200
resulText String 200 OK
item  String This is the references number that is returned with the delivery report

Single textual message to multiple destinations

Request

<?php
$url = "www.voodooSMS.com/vapi/server/sendSMS";
$getString ="?dest=447626691405,447626691255,447626691403&&";
$getString .="orig=TestingAPI&";
$getString .="msg=".urlencode("Testing The API")."&";
$getString .="pass=password&";
$getString .="uid=username&";
$getString .="validity=1";
$ch = curl_init();
//set the url, GET data
curl_setopt($ch, CURLOPT_URL, $url.$getString);
curl_setopt($ch, CURLOPT_HTTPGET,1); //default
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
//execute post
$result = curl_exec($ch);
echo($result);
//close connection
curl_close($ch);
?>

Response

<xml>
    <result>200</result>
    <resultText>200OK</resultText>
    <reference_id>
      <item>5883U8YDCF08122712161</item>
      <item>5MH2R672QD08122712162</item>
      <item>X9742DETI008122712163</item>
    </reference_id>
</xml>