Voice Sms Using API

Voice Sms Using API

Implantation of voice messaging through the php using some API its good to see the some of the site is providing this feature free for some features as well after upgrade you can use other advance features
Nexmo is one of the site who provide sms,voice sms, mms and other features
it provides APIfor all services also some of them free and limited and some of are chargeable
Here the Example code of sending voice sms from one number to another one.

//echo 'Current PHP version: ' . phpversion();
$params = [
    'api_key' => 'YOUR_API_KEY',
    'api_secret' => 'YOUR_API_SECRET',
    'to' => '91XXXXXXXXXX',//Receiver Contact number with country code
    'from' => '91XXXXXXXX',//Sender Contact number with country code
    'text' => 'Welcome to Programming Concept',

$url = 'https://api.nexmo.com/tts/json?' . http_build_query($params);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

About the code it has two key required api_key and api_secret key and using both key make post request of given url of nexmo api with parameter of sender and receiver contact number with country code and the voice message (in text format)

Leave a Reply

Your email address will not be published. Required fields are marked *