Send a WhatsApp text message to a phone number.
https://telcomw.com/api-v2/v1.wa.textSend key, password and appid as headers, and the message as a JSON body.
| Parameter | Sent in | Required | Description |
key |
header | YES | Your API key. |
password |
header | YES | Your account password. |
appid |
header | YES | The id of your WhatsApp app. |
phone |
body | YES | The phone number to send to, with the country code. |
message |
body | YES | The message. |
curl --location --request POST 'https://telcomw.com/api-v2/v1.wa.text' \
--header 'key: YOUR_API_KEY' \
--header 'password: YOUR_PASSWORD' \
--header 'appid: YOUR_APP_ID' \
--header 'Content-Type: application/json' \
--data '{
"phone": "+265992026866",
"message": "Boss?"
}'
curl --location --request POST "https://telcomw.com/api-v2/v1.wa.text" ^
--header "key: YOUR_API_KEY" ^
--header "password: YOUR_PASSWORD" ^
--header "appid: YOUR_APP_ID" ^
--header "Content-Type: application/json" ^
--data "{\"phone\":\"+265992026866\",\"message\":\"Boss?\"}"
<?php
$headers = [
'key: YOUR_API_KEY',
'password: YOUR_PASSWORD',
'appid: YOUR_APP_ID',
'Content-Type: application/json',
];
$data = [
'phone' => '+265992026866',
'message' => 'Boss?'
];
$ch = curl_init('https://telcomw.com/api-v2/v1.wa.text');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
const axios = require('axios');
axios.request({
method: 'post',
url: 'https://telcomw.com/api-v2/v1.wa.text',
headers: {
'key': 'YOUR_API_KEY',
'password': 'YOUR_PASSWORD',
'appid': 'YOUR_APP_ID',
'Content-Type': 'application/json'
},
data: {
"phone": "+265992026866",
"message": "Boss?"
}
}).then((res) => console.log(res.data))
.catch((err) => console.error(err.response ? err.response.data : err.message));
import requests
headers = {
'key': 'YOUR_API_KEY',
'password': 'YOUR_PASSWORD',
'appid': 'YOUR_APP_ID',
'Content-Type': 'application/json'
}
payload = {
'phone': '+265992026866',
'message': 'Boss?'
}
response = requests.request('POST', 'https://telcomw.com/api-v2/v1.wa.text', headers=headers, json=payload)
print(response.json())
The response is JSON.
{
"status": 200,
"message": "Your message was sent successfully!",
"ref": null
}