PHP Sample Code Voice SMS
<?php
//Your authentication key
$authKey = "YourAuthKey";
//Multiple mobiles numbers separated by comma
$mobileNumber = "9999999";
//Your voice file url
$file_url = "https://apitxt.com/filename.mp3";
//Your voice file id
$file_id = "V3BWYXpVSk5Ncms3ZUNVMTdON0IyUT09";
Note:-"File Url or File Id one required";
//Define route
$route = "1 or 4";
//Schedule voice
$schedule = "YYYY-MM-DD HH:MM"; //Time should be 24-hour format
//Prepare you post parameters
$postData = array(
'authkey' => $authKey,
'mobiles' => $mobileNumber,
'file_url' => $file_url,
'file_id' => $file_id,
'route' => $route,
'schedule' => $schedule
);
//API URL
$url="https://apitxt.com/api/sendVoiceSms";
// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
//,CURLOPT_FOLLOWLOCATION => true
));
//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
//get response
$output = curl_exec($ch);
//Print error if any
if(curl_errno($ch))
{
echo 'error:' . curl_error($ch);
}
curl_close($ch);
echo $output;
?>