Text CALL to 88440
info@voodooSMS.com

+44 (0)1484 599 311

Login Free Account

Developer Tools

Free Account

How to setup the Auto List feature

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

To enable this feature please complete the following steps:

1. Log into the portal and select Send SMS -> API Management -> API Auto List and click on '+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 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);
?>

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Servlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if (request.getAttribute("uid") != null && request.getAttribute("validity") != null
            && request.getAttribute("pass") != null  && request.getAttribute("dest") != null
            && request.getAttribute("orig") != null  && request.getAttribute("msg") != null
            && request.getAttribute("autolist") != null) {
            String charset = "UTF-8";
            String query = String.format("uid=%s&pass=%s&dest=%s&orig=%s&msg=%s&validity=%s&autolist=%s",
                URLEncoder.encode(request.getAttribute("uid").toString(), charset),
                URLEncoder.encode(request.getAttribute("pass").toString(), charset),
                URLEncoder.encode(request.getAttribute("dest").toString(), charset),
                URLEncoder.encode(request.getAttribute("orig").toString(), charset),
                URLEncoder.encode(request.getAttribute("msg").toString(), charset),
                URLEncoder.encode(request.getAttribute("validity").toString(), charset),
                URLEncoder.encode(request.getAttribute("autolist").toString(), charset));
            String url = "www.voodoosms.com/vapi/server/setupautolist";
            URLConnection connection = new URL(url + "?" + query).openConnection();
            connection.setRequestProperty("Accept-Charset", charset);
            InputStream reqres = connection.getInputStream();
            // reqres contains the request output
        } else {
            // Wrong parameters
        }
    }
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // Same as GET
    }
}


var http = require('http');
var https = require('https');
var querystring = require('querystring');
var url = require('url');
var server = http.createServer(function(req, res) {
    var url_parts = url.parse(req.url, true);
    var query = url_parts.query;
    var uid = query.uid;
    var pass = query.pass;
    var orig = query.orig;
    var dest = query.dest;
    var msg = query.msg;
    var validity = query.validity;
    var autolist = query.autolist;
    if (uid && pass && orig && dest && msg && validity && autolist) {
        var get_data = querystring.stringify({
            "uid": uid,
            "pass": pass,
            "dest": dest,
            "orig": orig,
            "msg": msg,
            "validity": validity,
            "autolist": autolist
        });
        var options = {
            host: 'www.voodoosms.com',
            path: '/vapi/server/setupautolist?' + get_data
        }
        https.get(options, function(reqres) {
            reqres.on('data', function(chunk) {
                res.end(chunk);
            })
        });
    } else
        res.end("Wrong parameters");
});

server.listen(8080);

require 'net/http'
require 'json'
class Controller < ApplicationController
    def index
        uid = params[: uid]
        pass = params[: pass]
        dest = params[: dest]
        orig = params[: orig]
        msg = params[: msg]
        validity = params[: validity]
        autolist = params[: autolist]
        if uid and pass and dest and orig and msg and validity and autolist
            uri = "?uid=" + uid + "&pass=" + pass + "&dest=" + dest + "&orig=" + orig + "&msg=" + msg +
            "&autolist=" + autolist + "&validity=" + validity
        else
            uri = 0
        end
        if uri != 0
            url = URI.parse('http://www.voodoosms.com/vapi/server/setupautolist' + uri)
            uri = URI(url)
            response = Net::HTTP.get(uri)
            @res = response
        else
            @res = "Wrong parameters"
        end
    end
end

from django.http
import HttpResponse, HttpRequest
import urllib2
def index(request):
  if request.method == 'GET':
    uid = request.GET.get('uid', '')
    pas = request.GET.get('pass', '')
    msg = request.GET.get('msg', '')
    orig = request.GET.get('orig', '')
    dest = request.GET.get('dest', '')
    validity = request.GET.get('validity', '')
    autolist = request.GET.get('autolist', '')
elif request.method == 'POST':
    uid = request.POST.get('uid', '')
    pas = request.POST.get('pass', '')
    msg = request.POST.get('msg', '')
    orig = request.POST.get('orig', '')
    dest = request.POST.get('dest', '')
    validity = request.POST.get('validity', '')
    autolist = request.POST.get('autolist', '')
if uid and pas and msg and orig and dest and validity and autolist:
    u = "?uid=%s&pass=%s&dest=%s&orig=%s&msg=%s&validity=%s&autolist=%s" % (uid, pass, dest, orig, msg,
    validity, autolist)
else :
    u = 0
if u:
    res = urllib2.urlopen("https://voodoosms.com/vapi/server/setupautolist" + u).read()
    return HttpResponse(res)
else :
  return HttpResponse("Wrong parameters")

using System;
using System.Net.Http;
using System.Web;

var client = new HttpClient();

//Get the parameters, either GET or POST request
    string uid = HttpContext.Current.Server.HtmlEncode(Request["uid"]);
    string pass = HttpContext.Current.Server.HtmlEncode(Request["pass"]);
    string dest = HttpContext.Current.Server.HtmlEncode(Request["dest"]);
    string orig = HttpContext.Current.Server.HtmlEncode(Request["orig"]);
    string msg = HttpContext.Current.Server.HtmlEncode(Request["msg"]);
    string validity = HttpContext.Current.Server.HtmlEncode(Request["validity"]);
    string autolist = HttpContext.Current.Server.HtmlEncode(Request["autolist"]);

//Exit if one or more parameters is missing
    if(String.IsNullOrEmpty(uid) || String.IsNullOrEmpty(pass) || String.IsNullOrEmpty(dest) ||
    String.IsNullOrEmpty(orig) || String.IsNullOrEmpty(msg) || String.IsNullOrEmpty(validity) ||
    String.IsNullOrEmpty(autolist)) System.Environment.Exit(1)

// Send the async request
    HttpResponseMessage response = await client.GetAsync(
    "https://www.voodoosms.com/vapi/server/setupautolist?uid=" + uid + "&pass="
    + pass + "&dest=" + dest + "&orig=" + orig + "&msg=" + msg + "&validity="
    + validity + "&autolist=" + autolist);

// Get the response content
HttpContent responseContent = response.Content;

// Get the stream of the content and write the output
using (var reader = new StreamReader(await responseContent.ReadAsStreamAsync()))
{
Console.WriteLine(await reader.ReadToEndAsync());
}

Please note, the contact list will not be generated immediately, it can take up to 15 minutes for the contact list to be available in the Contacts -> Contact Lists table.

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.