Sending a Voice call is completely different from Sending Text SMS. A Voice call involves multiple factor to be considered before & after the Voice Call is sent. But not to worry when you are using SainoFirst's Voice Platform. We've taken all complexities on us, so that you can have a seamless integration. To send voice call you have below options:-
Text-To-Speech based Voice Call
Pre-Recorded Audio File based voice Call
true
ā Not-Required if is_text is false
config
object. There is a separate section with detailed explanation.send_at
is passed in the request.true
ā Not-Required if is_text is false
true
ā Not-Required if is_text is false
true
for sending text-to-speech based voice call.
Set this to false
for sending pre-recorded audio based voice call.
If false : audio_file_url
parameter is mandatory.String
of numbers.{ "id":xxx, // permanent ID of current request "status":true, "message":"Voice Call Sent/scheduled Successfully."}
{ "status":false, "message":"Information about why the request is rejected (in string format)"}
{ "status":false, "message":"Auth-Error root cause will be stated here."}
{ "status":false, "message":"Forbidded Resource Access."}
{ "status":false, "message":"Something Went Wrong"}
A HTTP POST
request should contain body like below.
{"numbers": ["xxxxxxxxxx"], // if same message is to be sent on multiple numbers, just add them into this array"text": "This is text-to-speech service.","language_id": 4, // Language Id of Text"maxLengthOfCall": 30, // Maximum Length of call, in seconds"subscription_id": 5, // Subscription used (for Price calculation and Routing)"speech_rate": 1, // Speed of voice call (lower the value, slower the speed [0.5 to 2])"is_text": true,// The url at which you want to track the delivery report for this campaign"reportUrl": "https://app.sainofirst.com/api-delivery-endpoint?customKey1=CustomValue1&customKey2=CustomValue2"}
After the request is successfully received at our server, response will be like below with Status Code: 200
{"status":true,"message":"Voice Call scheduled Successfully.","id":xyz // request-id for this request, can be used for future references.}
A HTTP POST
request should contain body like below.
{"numbers": [ "xxxxxxxxxx" ], // if same message is to be sent on multiple numbers, just add then in this array like this"text": "This is text-to-speech service.","language_id": 4, // Language Id of Text"maxLengthOfCall": 30, // Maximum Length of call, in seconds"subscription_id": 5, // Subscription used (for Price calculation and Routing)"speech_rate": 1, // Speed of voice call (lower the value, slower the speed [0.5 to 2])"is_text": true,"config": { // optional"repeat": 1, // If pressed, voice message will be repeated (maxLengthOfCall will be counted)"callTransfer": {"transferKey": 2, // While call is active, pressing this key will forward the call"transferNumber": xxxxxxxxxx // Forward call to this Number}},"send_at": 1569266700, // required if scheduled for later date or time, otherwise optional"timezone": "Asia/Kolkata(GMT +05:30)" // timezone,// The url at which you want to track the delivery report for this campaign"reportUrl": "https://app.sainofirst.com/api-delivery-endpoint?customKey1=CustomValue1&customKey2=CustomValue2"}
After the request is successfully received at our server, response will be like below with Status Code: 200
{"status":true,"message":"Voice Call scheduled Successfully.","id":xyz // request-id for this request, can be used for future references.}
A HTTP POST
request should contain body like below.
{"numbers": [ "xxxxxxxxxx" ], // if same message is to be sent on multiple numbers, just add then in this array like this"maxLengthOfCall": 30, // Maximum Length of call, in seconds"subscription_id": 5, // Subscription used (for Price calculation and Routing)"is_text": false,"audio_file_url": "https://somefancy-audio-file-url", // required, is_text is true"config": { // optional"repeat": 1, // If pressed, voice message will be repeated (maxLengthOfCall will be counted)"callTransfer": {"transferKey": 2, // While call is active, pressing this key will forward the call"transferNumber": xxxxxxxxxx // Forward call to this Number}},"send_at": 1569266700, // required if scheduled for later date or time, otherwise optional"timezone": "Asia/Kolkata(GMT +05:30)", // timezone// The url at which you want to track the delivery report for this campaign"reportUrl": "https://app.sainofirst.com/api-delivery-endpoint?customKey1=CustomValue1&customKey2=CustomValue2"}
After the request is successfully received at our server, response will be like below with Status Code: 200
{"status":true,"message":"Voice Call scheduled Successfully.","id":xyz // request-id for this request, can be used for future references.}
Advanced voice call is the voice call where Listener (or Receiver) will be able to interact even with the simple pre-recorded or text-to-speech voice call. Features in Advance voice call:
Repeat the same voice message again on press of 'Assigned' key.
Forward the call to some other (predefined) number on press of 'Assigned' key.
Capture the response of every phone key pressed by the user while the call is going on.
The config
parameter of the request body is used to make a advanced voice call.
This parameter is a JSON Object which has two properties.
repeat
- Value must be a single digit number. On press of this number key, the call will be repeated.
callTransfer
- Value is an object with two properties:
transferKey
- Value must be a single digit number. On press of this number key, the call will be repeated.
Parameter | Value Type | Description |
| Single Digit Number | ā On press of this number key, the call will be repeated. ā The vice call will be disconnected automatically when the |
| Object | Must contain two properties inside this object. ā
|
Example:-
"config": { // optional"repeat": 1, // If pressed, voice message will be repeated (maxLengthOfCall will be counted)"callTransfer": {"transferKey": 2, // While call is active, pressing this key will forward the call"transferNumber": xxxxxxxxxx // Forward call to this Number}},
In order to get delivery reports directly into your system you need to take care of few simple things.
Please make sure that, the URL passed in the field reportUrl
, must accept HTTP POST
request with JSON
request body.
If you wish to get any additional data in the report callback, you should user query parameters and values in the URL itself.
If you don't pass the reportUrl
parameter in request body, we will not be able to push the reports to your system. However, messages will still be delivered to the destination.