Voice API

Overview

Make, execute and scale the voice call results with its amazing flexible capabilities. All this ensures high quality with productivity which is spread across a wide network and billed on a per-second basis. Our voice API lets make outbound calls, control in-progress calls and provide information about historical calls.

Authentication Key

HTTP requests to the APIs are protected with user-based authentication key authkey. For every request, you would be needing this key. Please visit here for more info.

Upload Voice API
Variable Value Explanation
auth user auth key This is the authkey which you generate from HTTP API
voice file type value this is post type value for audio file and will be .mp3 or .wav
NOTE : Only upload .mp3 or .wav file

NOTE : Only upload .mp3 or .wav file
https://voice.datagenit.com/API/upload_voice.php?auth=XXXX
Parameter POST: 'voice'  
  
  
Response
{"status":"success","code":100,"ts":"2018-11-20 16:00:09","voiceid":105}
{"status":"failure","code":401,"desc":"No Auth","ts":"2018-11-20 08:34:04"}
{"status":"failure","code":402,"desc":"Invalid Auth","ts":"2018-11-20 13:03:48"}
{"status":"failure","code":403,"desc":"Pass Valid Voice File","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":405,"desc":"Incorrect Audio Format","ts":"2018-11-20 13:04:39"}
{"status":"failure","code":406,"desc":"Blank Audio","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":407,"desc":"You Don't have HTTP API permission","ts":"2018-11-20 13:04:39"}
{"status":"failure","code":408,"desc":"Invalid file","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":409,"desc":"Invalid file extension","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":410,"desc":"Please Retry","ts":"2018-11-20 12:56:45"}
Sample Codes
$audio="full path of your audio file";
$target_url='https://voice.datagenit.com/API/upload_voice.php?auth=XXXX';
if (function_exists('curl_file_create')) { // php 5.5+
$cFile = curl_file_create($audio);
} else { // 
$cFile = '@' . realpath($audio);
}
$post = array('voice'=> $cFile);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response=curl_exec($ch);

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

Start Campaign API

Overview

Begin your voice API campaign today and provide customised calling experience to the users. Our voice API will turn your voice API into your business marketing campaign, allows you to choose customers and ensures a private communication between you and your users.

Upload Voice API
Variable Value Explanation
auth user auth key This is the authkey which you generate from HTTP API
voiceid 105 pass your voice id which you get from voice upload api
msisdn 9XXXXXXXXX,9XXXXXXXXX,8XXXXXXXXX You may have multiple numbers by comma separaited
type 1 1 for normal obd with voiceid and 2 for template with templateid
retry 0 default you can pass 0 to 3 (optional)
templateid The tempate id approved previouslly optional either voice id or template id.
keypress value will be either 0 (disable) or 1 (enable). optional for use this parameter first enable it from admin
NOTE : NOTE : pass either voiceid or templateid

https://voice.datagenit.com/API/start_campaign.php?auth=XXX&voiceid=105&msisdn=xxxxxx,xxxxxx,xxxxx&type=1&retry=3 
Parameters 
auth=XXX //your auth key
voiceid=105 // voice id which you want to play //required if type=1
msisdn=9971XXXXXX,9971XXXXXX //this is comma separated 10 digit mobile numbers without country code (max 100)
retry=0 // default 0 you can pass 0 to 3
type=1 // required
1 for normal obd with voiceid 
2 for template with templateid

templateid= 1 default 1 for sample obd// optional either voice id or template id //required if type=2
keypress=1 for enable key press and 0 for disable // optional for use this parameter first enable it from admin 
  
  
Response
{"status":"success","validcnt":1,"campg_id":22,"code":"100","ts":"2018-11-21 13:23:19"} 
{"status":"failure","code":401,"desc":"No Auth","ts":"2018-11-20 08:34:04"} 
{"status":"failure","code":402,"desc":"Invalid Auth","ts":"2018-11-20 13:03:48"} 
{"status":"failure","code":403,"desc":"No Call Flow","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":405,"desc":"missing type parameter","ts":"2018-11-20 13:04:39"}
{"status":"failure","code":406,"desc":"Voice ID Not Passed","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":407,"desc":"You Don't have HTTP API permission","ts":"2018-11-20 13:04:39"}
{"status":"failure","code":408,"desc":"Invalid Voice ID","ts":"2018-11-20 13:04:39"}
{"status":"failure","code":409,"desc":"Template ID Not Passed","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":410,"desc":"Msisdn Not Passed","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":411,"desc":"MSISDN Limit Exceed","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":412,"desc":"Insufficient Balance!","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":413,"desc":"Invalid Template ID","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":414,"desc":"Retry Not enable for this user","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":415,"desc":"you have allow max retry value 3","ts":"2018-11-20 12:56:45"}
{"status":"failure","code":416,"desc":"you don't have permission for keypress","ts":"2019-02-13 13:34:27"}
{"status":"failure","code":417,"desc":"keypress value is empty","ts":"2019-02-13 13:34:27"}
{"status":"failure","code":418,"desc":"keypress parameter value is invalid","ts":"2019-02-13 13:34:27"}
Sample Codes
$target_url="https://voice.datagenit.com/API/start_campaign.php?auth=XXXXX";
$postData = array(
'voiceid' => 105,
'msisdn' => 9971XXXXXX,9071XXXXXX,
'type'=>1,
'retry'=>3
);

$ch = curl_init($target_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);

echo $json;
Need Help

If you need any help related to the API integration then mail us on : Support@datagenit.com or call us : +91-9999-706-864

Our Team Will Help you related to your concern.

Home . Terms of use . Privacy policy