Credits

Get Credits

This API call can be used to check your credit balance in your Voodoo SMS account.

Definition

https:// www.voodooSMS.com/vapi/server/getCredit

Methods

GET

Required Parameters

uid: System allocated username for API user configured within the VoodooSMS.com Portal in Send SMS>API SMS>HTTP API.
pass: System password for API user configured within the VoodooSMS.com Portal in Send SMS>API SMS>HTTP API.
format: Return format requested: XML, JSON or PHP data.

Getting reports without any query parameter

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>

Transfer Credits

This call can be used by reseller accounts only to move credits between accounts via API.

Definition

https:// www.voodooSMS.com/vapi/server/transferCredit

Methods

GET

Required Parameters

uid: System allocated username for API user configured within the VoodooSMS.com Portal in Send SMS>API SMS>HTTP API.
pass: System password for API user configured within the VoodooSMS.com Portal in Send SMS>API SMS>HTTP API.
from_account: account ID to take the credits from.
to_account: account ID to add the credits to.
amount: the credits to transfer e.g. 100.
format: Return format requested: XML, JSON or PHP data.

Credit Transfer without any query parameter

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>