Send Voice Broadcast
Description
Send or Schedule a Voice Broadcast to a specific group. Accepts GET or POST requests.
URL
https://melotext.com/apis/sendvoicemessage/
Example Call: https://melotext.com/apis/sendvoicemessage/?apikey=APIKEY&group=GROUPNAME&message=MESSAGE&language=en-EN
PHP Code Sample (cURL):
$url = 'https://melotext.com/apis/sendvoicemessage/';
$fields = array('apikey' => $api_key,
'group' => $group,
'message' => $message,
'language' => $language,
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
$result = curl_exec($ch);
return $result;
Parameters
Parameters | Required | Description |
---|---|---|
apikey | Required | The API key of your account |
number | Required_If “group“ undefined | The number to send the message to. |
group | Required_If “number“ undefined | The group to broadcast the message to. |
message | Required | The message to send to the specified number. |
caller_id | Optional | The caller id to show during the call. |
language | Required | The language of the voice message to be read aloud. |
pause | Optional | Pause time in seconds. ID values are 0, 1. 0=>subscribed, 1=>unsubscribed. |
repeat_message | Optional | Times to repeat message. |
ivr_forward_number | Optional | Forwarding ivr number. |
schedule_broadcast | Optional | Schedule broadcast datetime. |
Return Values
Return Code | Description |
---|---|
0 | Successful API call. |
-1 | Invalid API key passed in. |
-2 | There was no caller id number passed in. |
-3 | Invalid API key passed in or account does not have access to send voice broadcast |
-4 | There was no message passed in to be sent. |
-5 | There was no group/number passed in. |
-6 | Voice broadbased message has been scheduled. |
-7 | Something went wrong, please try again. |
-8 | Subscribers not found in group, please try again. |
-9 | You do not have enough credits to send a broadcast to these contacts. |
-10 | Voice credit balance is too low. Please purchase more voice credits. |
-20 | Level 1 does not have access to the API. API can only be used with Levels 2, 3, and 4. |
Example API Response (data is returned in universal and lightweight JSON format)
{
"status":"-2",
"msg":"There was no caller id number passed in."
}