Integate whatsapp api in your application and automate messages
Send messages, conatcts, file, location and media any where
Reach your customers anywhere and automate response
Dashboard, Outbox, Inbox and Contacts all in hand
Embed WhatsApp to your comms stack in minutes
How to send text messages?
You can easily send messages using direct http get request as described in the following table:
Method | HTTP GET |
Request | https://server/send? recipient=[phone number]&apikey=[your apikey]&text=[text to send] |
Response | {"status":"Succes","code":0,"message":"Message queued","message_id":33503} |
import http.client
import json conn = http.client.HTTPSConnection("serverUrl")
payload = json.dumps({
"number": "XXXXXXX",
"apikey": "XXXXXXXXX",
"text": "Hi there",
"fileData": "",
"fileName": "",
"priority": 0,
"scheduledDate": "yyyy-MM-dd HH:mm:ss"
})
headers = {
'Content-Type': 'application/json'
}
conn.request("POST", "/send_message", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("http://serverUrl/send_message");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = "{
" + "\n" +
" ""number"":""XXXXXXX"",
" + "\n" +
" ""apikey"":""XXXXXXXXX"",
" + "\n" +
" ""text"":""Hi there"",
" + "\n" +
" ""fileData"":"""",
" + "\n" +
" ""fileName"":"""",
" + "\n" +
" ""priority"":0,
" + "\n" +
" ""scheduledDate"":""yyyy-MM-dd HH:mm:ss""
" + "\n" +
"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
require "uri"
require "json"
require "net/http"
url = URI("http://serverUrl/send_message")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"number": "XXXXXXX",
"apikey": "XXXXXXXXX",
"text": "Hi there",
"fileData": "",
"fileName": "",
"priority": 0,
"scheduledDate": "yyyy-MM-dd HH:mm:ss"
})
response = http.request(request)
puts response.read_body
?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://serverUrl/send_message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"number":"XXXXXXX",
"apikey":"XXXXXXXXX",
"text":"Hi there",
"fileData":"",
"fileName":"",
"priority":0,
"scheduledDate":"yyyy-MM-dd HH:mm:ss"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Choose the plan that fits your needs