Send Voice SMS Audio URL
groups contacts APIs, create a group pf contacts to send messages via api
- Json
- JavaScript
- Python
- Java
- PHP
- Dart
- C#
{
"contacts": ["2347046946265"],
"sender_id": "2348031346306",
"message": "false",
"send_date": "03-09-2021 00:42",
"campaign_name": "Promotion",
"voice_speed": 0,
"voice_gender": "female",
"voice_url": "https://whispersms.xyz/static/docs/Recording.m4a"
}
var myHeaders = new Headers();
myHeaders.append('Authorization', 'Token {{whisper_token}}');
myHeaders.append('Content-Type', 'application/json');
var raw = JSON.stringify({
contacts: ['2347046946265'],
sender_id: '2348031346306',
message: 'false',
send_date: '03-09-2021 00:42',
campaign_name: 'Promotion',
voice_speed: 0,
voice_gender: 'female',
voice_url: 'https://whispersms.xyz/static/docs/Recording.m4a',
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch('{{baseurl}}/whisper/send_voice_message/', requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import requests
import json
url = "{{baseurl}}/whisper/send_voice_message/"
payload = json.dumps({
"contacts": [
"2347046946265"
],
"sender_id": "2348031346306",
"message": "false",
"send_date": "03-09-2021 00:42",
"campaign_name": "Promotion",
"voice_speed": 0,
"voice_gender": "female",
"voice_url": "https://whispersms.xyz/static/docs/Recording.m4a"
})
headers = {
'Authorization': 'Token {{whisper_token}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("{{baseurl}}/whisper/send_voice_message/")
.header("Authorization", "Token {{whisper_token}}")
.header("Content-Type", "application/json")
.body("{\r\n \"contacts\":[\"2347046946265\"],\r\n \"sender_id\":\"2348031346306\",\r\n \"message\":\"false\",\r\n \"send_date\":\"03-09-2021 00:42\",\r\n \"campaign_name\":\"Promotion\",\r\n \"voice_speed\": 0,\r\n \"voice_gender\":\"female\",\r\n \"voice_url\": \"https://whispersms.xyz/static/docs/Recording.m4a\"\r\n}")
.asString();
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('{{baseurl}}/whisper/send_voice_message/');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"contacts":["2347046946265"],
"sender_id":"2348031346306",
"message":"false",
"send_date":"03-09-2021 00:42",
"campaign_name":"Promotion",
"voice_speed": 0,
"voice_gender":"female",
"voice_url": "https://whispersms.xyz/static/docs/Recording.m4a"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'Token {{whisper_token}}',
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var headers = {
'Authorization': 'Token {{whisper_token}}',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('{{baseurl}}/whisper/send_voice_message/'));
request.body = json.encode({
"contacts": [
"2347046946265"
],
"sender_id": "2348031346306",
"message": "false",
"send_date": "03-09-2021 00:42",
"campaign_name": "Promotion",
"voice_speed": 0,
"voice_gender": "female",
"voice_url": "https://whispersms.xyz/static/docs/Recording.m4a"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
var client = new RestClient("{{baseurl}}/whisper/send_voice_message/");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token {{whisper_token}}");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""contacts"":[""2347046946265""],
" + "\n" +
@" ""sender_id"":""2348031346306"",
" + "\n" +
@" ""message"":""false"",
" + "\n" +
@" ""send_date"":""03-09-2021 00:42"",
" + "\n" +
@" ""campaign_name"":""Promotion"",
" + "\n" +
@" ""voice_speed"": 0,
" + "\n" +
@" ""voice_gender"":""female"",
" + "\n" +
@" ""voice_url"": ""https://whispersms.xyz/static/docs/Recording.m4a""
" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Responses look like this
response
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
};
caution
BaseUrl: https//whispersms.xyz
You can send messages from here: