This call allows you to send SMS to one or multiple destinations.
http:// or https://
www.voodooSMS.com/vapi/server/sendSMS
Required Fields
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.
Parameter | Type | Description |
---|---|---|
result: | int | 200 |
resulText: | String | 200 OK |
item: | String | This is the references number that is returned with the delivery repor |
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>