Message Template API
groups contacts APIs, create a group pf contacts to send messages via api
- Json
- JavaScript
- Python
- Java
- PHP
- Dart
- C#
{
"title": "tecl",
"content_message": "ir creating the bjdjbdxbj"
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Token 69df6b9ea5e79e062b1418acf5ace190b47c64f4");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"title": "tecl",
"content_message": "ir creating the bjdjbdxbj"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("http://143.198.110.78/whisper/template/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import requests
import json
url = "http://143.198.110.78/whisper/template/"
payload = json.dumps({
"title": "tecl",
"content_message": "ir creating the bjdjbdxbj"
})
headers = {
'Authorization': 'Token 69df6b9ea5e79e062b1418acf5ace190b47c64f4',
'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("http://143.198.110.78/whisper/template/")
.header("Authorization", "Token 69df6b9ea5e79e062b1418acf5ace190b47c64f4")
.header("Content-Type", "application/json")
.body("{\r\n \"title\": \"tecl\",\r\n \"content_message\": \"ir creating the bjdjbdxbj\"\r\n \r\n}")
.asString();
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('http://143.198.110.78/whisper/template/');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"title": "tecl",
"content_message": "ir creating the bjdjbdxbj"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'Token 69df6b9ea5e79e062b1418acf5ace190b47c64f4',
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var headers = {
'Authorization': 'Token 69df6b9ea5e79e062b1418acf5ace190b47c64f4',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('http://143.198.110.78/whisper/template/'));
request.body = json.encode({
"title": "tecl",
"content_message": "ir creating the bjdjbdxbj"
});
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("http://143.198.110.78/whisper/template/");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token 69df6b9ea5e79e062b1418acf5ace190b47c64f4");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""title"": ""tecl"",
" + "\n" +
@" ""content_message"": ""ir creating the bjdjbdxbj""
" + "\n" +
@"
" + "\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: