Retailer magic: SMS strategies for Winter | On Demand Sign up for our webinar
This call will allow you to send a Web SMS via API. The destination number and message body will be supplied in a .csv or XLS file which needs to be made available via an external HTTP/SFTP site. The remainder of the settings such as the file name, send time and originator are supplied via the API call.
Please note, to use this feature you will need to first set up an external HTTP/SFTP site where the file can be collected. Web SMS via API can be enabled in Send SMS>API SMS>Web SMS via API.
https://
www.voodooSMS.com/vapi/server/sendWeb SMS/
<?php
switch($_SERVER["REQUEST_METHOD"]) {
case "GET":
$uid = htmlspecialchars($_GET["uid"]);
$pass = htmlspecialchars($_GET["pass"]);
$orig = htmlspecialchars($_GET["orig"]);
$name = htmlspecialchars($_GET["name"]);
$file = htmlspecialchars($_GET["file"]);
$locid = htmlspecialchars($_GET["locid"]);
$format = htmlspecialchars($_GET["format"]);
break;
case "POST":
$uid = htmlspecialchars($_POST["uid"]);
$pass = htmlspecialchars($_POST["pass"]);
$orig = htmlspecialchars($_POST["orig"]);
$name = htmlspecialchars($_POST["name"]);
$file = htmlspecialchars($_POST["file"]);
$locid = htmlspecialchars($_POST["locid"]);
$format = htmlspecialchars($_POST["format"]);
break;
}
$url = 'https://www.voodoosms.com/vapi/server/sendWebSMS?uid='.$uid.'&pass='.$pass.'&orig='.$orig
.'&name='.$name.'&file='.$file.'&locid='.$locid.'&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>
<status>1</status>
<reference_id>fNDc3bavOZ36</reference_id>
</xml>
This API call will return the Web SMS current status and completion percentage.
https://
www.voodooSMS.com/vapi/server/statsWebSMS
Request
<?php
switch($_SERVER["REQUEST_METHOD"]) {
case "GET":
$uid = htmlspecialchars($_GET["uid"]);
$pass = htmlspecialchars($_GET["pass"]);
$reference_id = htmlspecialchars($_GET["reference_id"]);
break;
case "POST":
$uid = htmlspecialchars($_POST["uid"]);
$pass = htmlspecialchars($_POST["pass"]);
$reference_id = htmlspecialchars($_POST["reference_id"]);
break;
}
$url = 'https://www.voodoosms.com/vapi/server/statsWebSMS?uid='.$uid.'&pass='.$pass.
'&reference_id='.$reference_id;
$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>
<summary>
<total_sent>3</total_sent>
<total_complete>2</total_complete>
<total_delivered>1</total_delivered>
<total_pending>1</total_pending>
<total_bounced>1</total_bounced>
</summary>
<data>
<item>
<sent_datetime>2018-06-28 14:40:00</sent_datetime>
<broadcast_name>first websms via api</broadcast_name>
<destination_number>44xxxxxxxxxx</destination_number>
<delivery_status>delivered</delivery_status>
<delivery_datetime>2018-06-28 14:42:00</delivery_datetime>
<contact_list>first websms via api List</contact_list>
<message>testing+124</message>
<reference_id>301932205945wsms</reference_id>
</item>
<item>
<sent_datetime>2018-06-28 14:40:00</sent_datetime>
<broadcast_name>first websms via api</broadcast_name>
<destination_number>44xxxxxxxxxx</destination_number>
<delivery_status>pending</delivery_status>
</delivery_datetime>
<contact_list>first websms via api List</contact_list>
<message>test+123</message>
<reference_id>301932205946wsms</reference_id>
</item>
<item>
<sent_datetime>2018-06-28 14:40:00</sent_datetime>
<broadcast_name>first websms via api</broadcast_name>
<destination_number>44xxxxxxxxxx</destination_number>
<delivery_status>bounced</delivery_status>
<delivery_datetime>2018-06-28 14:43:00</delivery_datetime>
<contact_list>first websms via api List</contact_list>
<message>testing+456</message>
<reference_id>301932205947wsms</reference_id>
</item>
</data>
</xml>