Send a message to a phone number, or a different message to many numbers, with a JSON body. The credentials go in the headers.
https://telcomw.com/api-v2/extended/sendSend from, api_key and password as headers, and the messages as a JSON array in the body.
| Parameter | Sent in | Required | Description |
from |
header | YES | The sender ID, for example WGIT. |
api_key |
header | YES | Your API key. |
password |
header | YES | Your account password. |
[].message |
body | YES | The content of the message that you want to send. |
[].phone |
body | YES | The recipient's phone number in international format. |
curl --location --request POST 'https://telcomw.com/api-v2/extended/send' \
--header 'from: WGIT' \
--header 'api_key: YOUR_API_KEY' \
--header 'password: YOUR_PASSWORD' \
--header 'Content-Type: application/json' \
--data '[
{
"message": "Hello",
"phone": "265992026866"
},
{
"message": "Hello 2",
"phone": "265884113450"
}
]'
curl --location --request POST "https://telcomw.com/api-v2/extended/send" ^
--header "from: WGIT" ^
--header "api_key: YOUR_API_KEY" ^
--header "password: YOUR_PASSWORD" ^
--header "Content-Type: application/json" ^
--data "[{\"message\":\"Hello\",\"phone\":\"265992026866\"},{\"message\":\"Hello 2\",\"phone\":\"265884113450\"}]"
<?php
$headers = [
'from: WGIT',
'api_key: YOUR_API_KEY',
'password: YOUR_PASSWORD',
'Content-Type: application/json',
];
$data = [
[
'message' => 'Hello',
'phone' => '265992026866'
],
[
'message' => 'Hello 2',
'phone' => '265884113450'
]
];
$ch = curl_init('https://telcomw.com/api-v2/extended/send');
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/extended/send',
headers: {
'from': 'WGIT',
'api_key': 'YOUR_API_KEY',
'password': 'YOUR_PASSWORD',
'Content-Type': 'application/json'
},
data: [
{
"message": "Hello",
"phone": "265992026866"
},
{
"message": "Hello 2",
"phone": "265884113450"
}
]
}).then((res) => console.log(res.data))
.catch((err) => console.error(err.response ? err.response.data : err.message));
import requests
headers = {
'from': 'WGIT',
'api_key': 'YOUR_API_KEY',
'password': 'YOUR_PASSWORD',
'Content-Type': 'application/json'
}
payload = [
{
'message': 'Hello',
'phone': '265992026866'
},
{
'message': 'Hello 2',
'phone': '265884113450'
}
]
response = requests.request('POST', 'https://telcomw.com/api-v2/extended/send', headers=headers, json=payload)
print(response.json())
The response is JSON.
{
"type": "success",
"msg": "send",
"code": "200",
"advance": "1",
"feedback": [
{
"status": 2,
"cost": 20,
"msdn": "265992026866",
"chars": 5,
"code": 200,
"id": "nexp7hdwhmfu"
},
{
"status": 2,
"cost": 20,
"msdn": "265884113450",
"chars": 7,
"code": 200,
"id": "iqenjjepnum5"
}
]
}
| Field | Description |
type | The type of response. |
msg | A message about the status of the request. |
code | A code for the outcome of the request. |
advance | Additional information about the request. |
feedback[].status | The status of the message. 2 means the message was sent. |
feedback[].cost | The cost of the message. |
feedback[].msdn | An identifier for the message. |
feedback[].chars | The number of characters in the message. |
feedback[].code | A code for the result of sending the message. |
feedback[].id | A unique identifier of the sent message. |