Send Voice via Library - Out Bound Dialer (OBD) Voice Call API Documentation

Send Voice via Library - Out Bound Dialer (OBD)

The following Voice Call API sample can be used to send out Bulk Voice Call (OBD) using Library in Single, Bulk, Group and Bulk Upload.

Execute Java Sample Code - Live Demo

 

Import Voice Call API postman collection.

Postman Collection

 

Application API URL:

https://www.smsgateway.center/VoiceApi/rest/send

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.
Required Parameters
sendMethod simpleVoice | groupVoice | bulkVoice

simpleVoice: This value required for single or comma separated mobile numbers voice calling.

groupVoice: This value required for Group Voice option.

bulkVoice: This value required for Bulk Upload option.

audioType library You need to specify library when you want to send the voice call through libraryId.
Default Parameters (Optional)
libraryId library ID (Integer) audioType=library required for this parameter. This is the library ID which you could save using API or UI. Every saved audio in the library, a libraryId is assigned for future use. You can use the libraryId without having to upload any audio file. If the libraryId included, then system will send the saved voice clip from your personal library without having to upload an audio file via API.
reDial 0|1|2 Number of redial attempts to be done if user is busy or unanswered by the recipient.

System default is 2.
redialInterval 5|10|15 ‐> Promotional
1 to 10 ‐> Transactional
Time in minutes to specify the interval for redial attempts.

System default is 5 for promotional and 2 for transactional.
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.
duplicateCheck true|false Checks and removes Duplicate mobile numbers.

System default is true. You can turn off duplicate checking of mobile numbers by giving value as false, duplicate numbers wont be removed.
scheduleTime datetime format (YYYY-MM-DD HH:MM:SS) Value for Scheduling.

System default is null. If you want to enable then use this parameter and give value as YYYY-MM-DD HH:MM:SS.
Simple Message - Single or Bulk (Required for simpleVoice)
mobile 10 or 12 Digits mobile number. Mobile number format can be 10 to 12 digits prefix with 0 or 91. Preferred mobile format is prefix with country code 91. You can include single number or comma separated numbers. Maximum comma separated mobile numbers allowed are 1000.

While sending Simple message, sendMethod parameter needs to be simpleVoice
Group Message - Single or Multiple Groups (Required for groupVoice)
group Group IDs / Group Names.
Example:

1123,1321 OR

mygroup, othergroup OR

1123,mygroup
Sending SMS to your saved Contacts grouped by Group Name or Group ID.

You can send to single group or multiple groups at once separated by comma. Valid Group IDs or Group names should be mentioned in this parameter. For multiple groups, please separate by comma.

While sending Group SMS message, sendMethod parameter needs to be groupVoice
Bulk Upload (Required for bulkVoice)
phoneList Phone List file path with any .csv | .xls | .xlsx | .zip | .txt extension. We allow 5 extensions in bulk upload.

Maximum File Size Allowed: 15MB

Maximum Rows Allowed: 1 Million

While sending Bulk Upload message, sendMethod parameter needs to be bulkVoice
Test
testVoice true | false System default is false. Set this to true if you want to test our API. Voice wont be delivered and Voice balance wont be deducted. If you do not use this parameter, the value of this parameter will be false.

Sample API URL End Points:

You can understand how and what parameters needs to be included when you send different kinds of voice call.

Voice Call with Audio Upload (POST & GET METHOD):

API: https://www.smsgateway.center/VoiceApi/rest/send
userId=YourUsername&password=YourPassword&sendMethod=simpleVoice&audioType=library&libraryId=12342342345132&mobile=99999999xx,9999999xxx&reDial=2&redialInterval=5&format=json

Save this Page on your Favorite Social Media

Sample Request Code

POST METHOD

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/VoiceApi/rest/send",
  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=YourPassword&audioType=library&sendMethod=simpleVoice&mobile=919999999999%2C%20919999999998&duplicateCheck=true&libraryId=5784862973990422090&reDial=0&redialInterval=5&format=json",
  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;
}

POST METHOD

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/VoiceApi/rest/send?userId=YourUsername&password=YourPassword&audioType=library&sendMethod=simpleVoice&mobile=919999999999%2C%20919999999998&duplicateCheck=true&libraryId=5784862973990422090&reDial=0&redialInterval=5&format=json",
  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;
}

POST METHOD

import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;


public class SMSGatewayCenter{

public static void main(String[] args)
{
//OR
String userId = "YourUsername";
String password = "YourPassword";

//Send Method
String sendMethod = "simpleVoice";

//Audio type audio/library/t2s
String audioType = "library";

//Multiple mobiles numbers separated by comma
String mobile = "919999999999";
//Your active library id
String libraryId = "5784862973990422090";
//number of redial attempts to be made
String reDial = "2";
//interval time in minutes options 5|10|15
String redialInterval = "5";
//response format
String format = "json";

//Prepare Url
URLConnection myURLConnection=null;
URL myURL=null;
BufferedReader reader=null;

//API End Point
String mainUrl="https://www.smsgateway.center/VoiceApi/rest/send?";

//API Paramters
StringBuilder sendSmsData= new StringBuilder(mainUrl);
sendSmsData.append("&userId="+userId);
sendSmsData.append("&password="+password);
sendSmsData.append("&sendMethod="+sendMethod);
sendSmsData.append("&audioType="+audioType);
sendSmsData.append("&mobile="+mobile);
sendSmsData.append("&libraryId="+libraryId);
sendSmsData.append("&reDial="+reDial);
sendSmsData.append("&redialInterval="+redialInterval);
sendSmsData.append("&format="+format);
//final string
mainUrl = sendSmsData.toString();
try
{
//prepare connection
myURL = new URL(mainUrl);
myURLConnection = myURL.openConnection();
myURLConnection.connect();
reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream()));
//reading response
String response;
while ((response = reader.readLine()) != null)
//print response
System.out.println(response);

//finally close connection
reader.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}

Response

{
    "status": "success",
    "mobile": "9199999999xx, 9199999999xx",
    "invalidMobile": "",
    "transactionId": "595748da-bab8-4da7-ae9e-5a97007ae49b",
    "statusCode": "900",
    "reason": "success"
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simpleMessageSuccessResponse>
    <invalidMobile></invalidMobile>
    <mobile>9199999999xx, 9199999999xx</mobile>
    <reason>success</reason>
    <status>success</status>
    <statusCode>900</statusCode>
    <transactionId>608e6f4a-5ab6-49a2-b2ea-02e47005d794</transactionId>
</simpleMessageSuccessResponse>
status=success | mobile=9199999999xx, 9199999999xx | invalidMobile= | transactionId=b4c7a895-773e-4cff-b4cb-5df2d6fa4139 | errorCode=900 | reason=success