Optin Subscribers Report Bulk SMS API Documnetation

Optin Subscribers Report

View Optin Subscribers Report

This report helps you download all optin subscribers who are opted in to receive SMS from your end. Even DND registered customers can receive SMS after optinf for this service.

Application API URL:

https://www.smsgateway.center/library/api/self/OptinReport/

 

If you have huge record set, try to use lesser between dates for quicker report fetch.

 

Key Value Description
Login Credentials (Required Parameters)
Authenticate your API request using userId-password or apiKey. You should use either one to authenticate your login.
userId Your Registered Username The registered username parameter to be passed. You can use this if apiKey is not being used.
password Your password The password needs to be urlencoded if there are any special characters used in the password field. You can use this if apiKey is not being used.
apiKey Your unique apiKey apiKey needs to be sent as HTTP header when you are not using userId and password credentials. You can avail this from your user control panel and use instead of userId and password HTTP Request parameter. Please do not disclose this to anyone.
Additional Required Parameters
FromDate From date Date format needs to be YYYY-MM-DD. Start Date of the report required
ToDate To date Date format needs to be YYYY-MM-DD. End Date of the report required
format plain|json|xml Value for response format.

System default is plain. If you need responses in JSON or XML then you have to give value as JSON or XML.

Save this Page on your Favorite Social Media

Sample Request Code

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/library/api/self/OptinReport/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "userId=YourUsername&password=YourCurrentPassword&format=json&FromDate=2017-07-01&ToDate=2017-07-31",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/library/api/self/OptinReport/?userId=YourUsername&password=YourCurrentPassword&format=json&FromDate=2017-07-01&ToDate=2017-07-31",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var qs = require("querystring");
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "www.smsgateway.center",
  "port": null,
  "path": "/library/api/self/OptinReport/",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(qs.stringify({ userId: 'YourUsername',
  password: 'YourCurrentPassword',
  format: 'json',
  FromDate: '2017-07-01',
  ToDate: '2017-07-31' }));
req.end();
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "www.smsgateway.center",
  "port": null,
  "path": "/library/api/self/OptinReport/?userId=YourUsername&password=YourCurrentPassword&format=json&FromDate=2017-07-01&ToDate=2017-07-31",
  "headers": {
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "userId=YourUsername&password=YourCurrentPassword&format=json&FromDate=2017-07-01&ToDate=2017-07-31");
Request request = new Request.Builder()
  .url("https://www.smsgateway.center/library/api/self/OptinReport/")
  .post(body)
  .addHeader("content-type", "application/x-www-form-urlencoded")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://www.smsgateway.center/library/api/self/OptinReport/?userId=YourUsername&password=YourCurrentPassword&format=json&FromDate=2017-07-01&ToDate=2017-07-31")
  .get()
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

Response

{
    "status": "success",
    "statusCode": "900",
    "transactionId": "1d53848e-26d1-4852-ba4f-1c7fa18eda50",
    "reason": "Data Fetched.",
    "noofRecords": 4,
    "OptinReport": [
        {
            "Phone": "919xxxxxxxxx",
            "Status": "join",
            "Group Name": "SGCSMS",
            "Join Timestamp": "2015-01-08 13:05:35",
            "Rejoin/Leave Timestamp": "0000-00-00 00:00:00"
        },
        {
            "Phone": "919xxxxxxxxx",
            "Status": "join",
            "Group Name": "SGCSMS",
            "Join Timestamp": "2015-01-08 13:16:42",
            "Rejoin/Leave Timestamp": "0000-00-00 00:00:00"
        },
        {
            "Phone": "919xxxxxxxxx",
            "Status": "join",
            "Group Name": "SGCSMS",
            "Join Timestamp": "2015-01-08 14:00:36",
            "Rejoin/Leave Timestamp": "0000-00-00 00:00:00"
        },
        {
            "Phone": "919xxxxxxxxx",
            "Status": "join",
            "Group Name": "SGCSMS",
            "Join Timestamp": "2015-01-08 21:49:37",
            "Rejoin/Leave Timestamp": "0000-00-00 00:00:00"
        }
    ]
}
<?xml version="1.0" encoding="UTF-8"?>
<OptinReportResponse>
    <status>success</status>
    <statusCode>900</statusCode>
    <reason>Data Fetched.</reason>
    <transactionId>83f7a0ba-e41b-42bd-a418-0bc988208ce4</transactionId>
    <noofRecords>4</noofRecords>
    <OptinReport>
        <Phone>919xxxxxxxxx</Phone>
        <Status>join</Status>
        <GroupName>SGCSMS</GroupName>
        <JoinTimestamp>2015-01-08 13:05:35</JoinTimestamp>
        <Rejoin_Leave_Timestamp>0000-00-00 00:00:00</Rejoin_Leave_Timestamp>
    </OptinReport>
    <OptinReport>
        <Phone>919xxxxxxxxx</Phone>
        <Status>join</Status>
        <GroupName>SGCSMS</GroupName>
        <JoinTimestamp>2015-01-08 13:16:42</JoinTimestamp>
        <Rejoin_Leave_Timestamp>0000-00-00 00:00:00</Rejoin_Leave_Timestamp>
    </OptinReport>
    <OptinReport>
        <Phone>919xxxxxxxxx</Phone>
        <Status>join</Status>
        <GroupName>SGCSMS</GroupName>
        <JoinTimestamp>2015-01-08 14:00:36</JoinTimestamp>
        <Rejoin_Leave_Timestamp>0000-00-00 00:00:00</Rejoin_Leave_Timestamp>
    </OptinReport>
    <OptinReport>
        <Phone>919xxxxxxxxx</Phone>
        <Status>join</Status>
        <GroupName>SGCSMS</GroupName>
        <JoinTimestamp>2015-01-08 21:49:37</JoinTimestamp>
        <Rejoin_Leave_Timestamp>0000-00-00 00:00:00</Rejoin_Leave_Timestamp>
    </OptinReport>
</OptinReportResponse>
Phone, Status, Group Name, Joined Time, Rejoin/Leave Time
<br>919xxxxxxxxx,join,SGCSMS,2015-01-08 13:05:35,0000-00-00 00:00:00
<br>919xxxxxxxxx,join,SGCSMS,2015-01-08 13:16:42,0000-00-00 00:00:00
<br>919xxxxxxxxx,join,SGCSMS,2015-01-08 14:00:36,0000-00-00 00:00:00
<br>919xxxxxxxxx,join,SGCSMS,2015-01-08 21:49:37,0000-00-00 00:00:00