Retailer magic: SMS strategies for Black Friday | On Demand Sign up for our webinar
This API call can be used to check your credit balance in your Voodoo SMS account.
https://
www.voodooSMS.com/vapi/server/getCredit
Request
<?php
switch($_SERVER["REQUEST_METHOD"]) {
case "GET":
$uid = htmlspecialchars($_GET["uid"]);
$pass = htmlspecialchars($_GET["pass"]);
$format = htmlspecialchars($_GET["format"]);
break;
case "POST":
$uid = htmlspecialchars($_POST["uid"]);
$pass = htmlspecialchars($_POST["pass"]);
$format = htmlspecialchars($_POST["format"]);
break;
}
$url = 'https://www.voodoosms.com/vapi/server/getCredit?uid='.$uid.'&pass='.$pass."&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 OK</result>
<credit>9928597.0680</credit>
</xml>
This call can be used by reseller accounts only to move credits between accounts via API.
https://
www.voodooSMS.com/vapi/server/transferCredit
Request
<?php
switch($_SERVER["REQUEST_METHOD"]) {
case "GET":
$uid = htmlspecialchars($_GET["uid"]);
$pass = htmlspecialchars($_GET["pass"]);
$from_account = htmlspecialchars($_GET["from_account"]);
$to_account = htmlspecialchars($_GET["to_account"]);
$amount = htmlspecialchars($_GET["amount"]);
$format = htmlspecialchars($_GET["format"]);
break;
case "POST":
$uid = htmlspecialchars($_POST["uid"]);
$pass = htmlspecialchars($_POST["pass"]);
$from_account = htmlspecialchars($_POST["from_account"]);
$to_account = htmlspecialchars($_POST["to_account"]);
$amount = htmlspecialchars($_POST["amount"]);
$format = htmlspecialchars($_POST["format"]);
break;
}
$url = 'https://www.voodoosms.com/vapi/server/transferCredit?uid='.$uid.'&pass='.$pass'&from_account='
.$from_account'&to_account='.$to_account."&amount=".$amount."&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 OK</result>
<resultText>Credits Successfully Transfered</resultText>
</xml>