Contact Lists

Retrieve List

Use this API call to retrieve contact lists that are currently stored in your Voodoo SMS account.

Definition

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

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 contact lists currently available on your account

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/getLists?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>
   <status>200</status>
   <resultText>200 OK</resultText>
   <owner_id>50036</owner_id>
   <total_contact_list>181</total_contact_list>
   <contact_list>
      <item>
         <list_id>6355</list_id>
         <list_name>New my test</list_name>
         <list_size>10</list_size>
         <active_contacts>10</active_contacts>
         <custom_fields>[]</custom_fields>
         <last_update>2017-07-25 12:34:55</last_update>
      </item>
      <item>
         <list_id>6283</list_id>
         <list_name>Rao 1</list_name>
         <list_size>8</list_size>
         <active_contacts>8</active_contacts>
         <custom_fields>["number_name"]</custom_fields>
         <last_update>2016-11-03 07:48:31</last_update>
      </item>
   </contact_list>
</xml>

Retrieve Contacts

Combined with the list_id of the Contact List from the “Retrieve List” API, this will show the contacts assigned to that list.

Definition

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

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.
listid: Pass Contact list id
format: Return format requested: XML, JSON or PHP data.

Getting contact list numbers currently available on your account

Request
<?php
switch($_SERVER["REQUEST_METHOD"]) {
    case "GET":
        $uid = htmlspecialchars($_GET["uid"]);
        $pass = htmlspecialchars($_GET["pass"]);
        $listid = htmlspecialchars($_GET["listid"]);
        break;
    case "POST":
        $uid = htmlspecialchars($_POST["uid"]);
        $pass = htmlspecialchars($_POST["pass"]);
        $listid = htmlspecialchars($_POST["listid"]);
        break;
}
$url = 'https://www.voodoosms.com/vapi/server/getContactLists?uid='.$uid.'
        &pass='.$pass.'&listid='.$listid;
$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>
   <status>200</status>
   <resultText>200 OK</resultText>
   <group_name>contact list manual</group_name>
   <group_size>4</group_size>
   <contact_list>
      <item>
         <cnt_number>447700900604</cnt_number>
      </item>
      <item>
         <cnt_number>447700900603</cnt_number>
      </item>
      <item>
         <cnt_number>447700900622</cnt_number>
      </item>
      <item>
         <cnt_number>447700900420</cnt_number>
      </item>
   </contact_list>
</xml>

Add Contacts

This call allows you to add a contact or multiple contacts to a specific contact list.

Definition

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

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.
listid: for contact list id.
number: Add a single or multiple numbers (comma separated) e.g. 447700900000,447700777888.
format: Return format requested: XML, JSON or PHP data.

Optional Parameters

custfield1: 1st custom field
custfield2: 2nd custom field
custfield3: 3rd custom field
custfield4: 4th custom field
custfield5: 5th custom field
custfield6: 6th custom field
cc: Country code

Add contact list on your account

Request
<?php
switch($_SERVER["REQUEST_METHOD"]) {
    case "GET":
        $uid = htmlspecialchars($_GET["uid"]);
        $pass = htmlspecialchars($_GET["pass"]);
        $listid = htmlspecialchars($_GET["listid"]);
        $number = htmlspecialchars($_GET["number"]);
        $format = htmlspecialchars($_GET["format"]);
        break;
    case "POST":
        $uid = htmlspecialchars($_POST["uid"]);
        $pass = htmlspecialchars($_POST["pass"]);
        $listid = htmlspecialchars($_POST["listid"]);
        $number = htmlspecialchars($_POST["number"]);
        $format = htmlspecialchars($_POST["format"]);
        break;
}
$url = 'https://www.voodoosms.com/vapi/server/addContact?uid='.$uid.'&pass='.$pass.'&listid='.$listid
    .'&number='.$number."&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>
   <status>200</status>
   <resultText>You have successfully updated the contact list</resultText>
   <list_id>6355</list_id>
   <list_name>New my test</list_name>
   <list_size>10</list_size>
   <active_contacts>10</active_contacts>
   <total_contacts_supplied>1</total_contacts_supplied>
   <blacklist_numbers>0</blacklist_numbers>
   <not_allowed>0</not_allowed>
   <already_exists>1</already_exists>
   <invalid_numbers>0</invalid_numbers>
   <contacts_imported>0</contacts_imported>
</xml>

Setup AutoList

The Auto List feature provides the ability to automatically insert contacts into a contact list if/when sent SMS has been marked as delivered.

To enable this feature please complete the following steps:

  1. Click on ‘+Auto List’ button available in Send SMS>API SMS>API Auto List.
  2. This form will create a template which will be used to create a new contact list at the beginning of each month.

Auto List Name This is the internal name within the Auto List feature.

Description You can enter a description here for future reference.

New Contact List Name The text entered here will be used when a contact list is created at the beginning of each month.

e.g. If ‘Demo Auto List’ is entered, the list created in July 2015 will be named as ‘Demo Auto List - July 2016’ , August 2016 - ‘Demo Auto List - August 2016’ and On clicking ‘Submit’ the platform will save the information and generate an Auto List ID to use within the API Call.

3. The Auto List section will display the Group ID in the table, this value needs to be added to your API Call as follows:

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"]);
        $validity = htmlspecialchars($_GET["validity"]);
        $autolist = htmlspecialchars($_GET["autolist"]);
        break;
    case "POST":
        $uid = htmlspecialchars($_POST["uid"]);
        $pass = htmlspecialchars($_POST["pass"]);
        $dest = htmlspecialchars($_POST["dest"]);
        $orig = htmlspecialchars($_POST["orig"]);
        $msg = htmlspecialchars($_POST["msg"]);
        $validity = htmlspecialchars($_POST["validity"]);
        $autolist = htmlspecialchars($_POST["autolist"]);
        break;
}

$url = 'https://www.voodoosms.com/vapi/server/setupautolist?autolist='.$autolist.'uid='.$uid.
    '&pass='.$pass.'&dest='.$dest.'&orig='.$orig.'&msg='.$msg.'&validity='.$validity;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$data = curl_exec($ch);

// 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>200OK</resultText>
   <reference_id>
      <item>5883U8YDCF08122712161</item>
   </reference_id>
</xml>

4. It is possible to set up multiple Auto Lists, you will need to specify the different autolist_ID as required to ensure that the contact is inserted into the correct list.