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

Send Voice - Out Bound Dialer (OBD)

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

 

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 t2s|audio|library You need to specify t2s when message needs to be converted to audio.
You need to specify library when you want to send the voice call through libraryId. You need to assign value as audio when you upload audioTrack.
Default Parameters (Optional)
audioTrack Audio file path .mp3 or .wav audioType=audio required for this parameter. File path to be given of the file. Only .mp3 or .wav file allowed in upload.
saveAudio true|false Default value is false. Set this to True to save the current audio in your library and later you can use this audio by just stating the libraryId.
libraryName string max 20 chars name Default value is null. If saveAudio=true then you need to name the name of the library within 20 characters. (format = alphanumeric with space)
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.
msgType text|unicode audioType=t2s required for this parameter. This is to define simple or UNICODE message. For simple English, you can give value as text or for non-English messages, give value as unicode.
msg Your text message audioType=t2s required for this parameter. In voice calls, mostly used for OTP delivery purpose. This option needs to be enabled for your account.

Default Text to Speech Engine will be used to convert text to speech and delivered as Audio Track to the recipient.
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 METHOD):

API: https://www.smsgateway.center/VoiceApi/rest/send
POST PARAMS: userId=YourUsername&password=YourPassword&sendMethod=simpleVoice&audioType=audio&audioTrack=/path/to/file&mobile=99999999xx,9999999xxx&reDial=2&redialInterval=5&format=json

Voice Call with Text to Speech:

https://www.smsgateway.center/VoiceApi/rest/send?userId=YourUsername&password=YourPassword&sendMethod=simpleVoice&audioType=t2s&msg=Your OTP Code is 1234&msgType=text&mobile=99999999xx,9999999xxx&reDial=2&redialInterval=5&format=json

Voice Call with Library:

https://www.smsgateway.center/VoiceApi/rest/send?userId=YourUsername&password=YourPassword&sendMethod=simpleVoice&audioType=library&libraryId=863713123&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 => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"userId\"\r\n\r\nYourUsername\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nYourPassword\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"audioType\"\r\n\r\naudio\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"sendMethod\"\r\n\r\nsimpleVoice\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n919999999999, 919999999998\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"duplicateCheck\"\r\n\r\ntrue\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"format\"\r\n\r\njson\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"audioTrack\"; filename=\"sgc_audio_test.mp3\"\r\nContent-Type: audio/mpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
  ),
));

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

curl_close($curl);

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

POST METHOD

Coming soon!

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