See what a campaign would cost before you create it. Nothing is saved and nothing is charged.
https://telcomw.com/api/v3/campaigns/quoteSend a JSON body with the header Content-Type: application/json. Your API key goes in the X-API-Key header.
| Parameter | Sent in | Required | Description |
X-API-Key |
header | YES | Your API key, sent as a header. You can also send it as Authorization: Bearer YOUR_API_KEY. |
message |
body | YES | The text of the message, to count its pages. |
to |
body | NO | The phone numbers, as a list of text. Send this or group_id. |
group_id |
body | NO | The number of one of your phonebook groups. Send this or to. |
skip_invalid |
body | NO | true to leave out the phone numbers that are not valid and send to the rest. By default one invalid number rejects the whole request, and nothing is sent or charged. |
curl --location --request POST 'https://telcomw.com/api/v3/campaigns/quote' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": "Our sale starts today. Visit us!",
"to": [
"0999123456",
"0888123456",
"0999123456"
]
}'
curl --location --request POST "https://telcomw.com/api/v3/campaigns/quote" ^
--header "X-API-Key: YOUR_API_KEY" ^
--header "Content-Type: application/json" ^
--data "{\"message\":\"Our sale starts today. Visit us!\",\"to\":[\"0999123456\",\"0888123456\",\"0999123456\"]}"
<?php
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json',
];
$data = [
'message' => 'Our sale starts today. Visit us!',
'to' => [
'0999123456',
'0888123456',
'0999123456'
]
];
$ch = curl_init('https://telcomw.com/api/v3/campaigns/quote');
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/v3/campaigns/quote',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
data: {
"message": "Our sale starts today. Visit us!",
"to": [
"0999123456",
"0888123456",
"0999123456"
]
}
}).then((res) => console.log(res.data))
.catch((err) => console.error(err.response ? err.response.data : err.message));
import requests
headers = {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
payload = {
'message': 'Our sale starts today. Visit us!',
'to': [
'0999123456',
'0888123456',
'0999123456'
]
}
response = requests.request('POST', 'https://telcomw.com/api/v3/campaigns/quote', headers=headers, json=payload)
print(response.json())
The response is JSON.
{
"success": true,
"request_id": "req_5f2c9a1d0e7b4a63",
"data": {
"recipients": 2,
"over_limit": false,
"invalid_count": 0,
"duplicates": 1,
"pages": 2,
"cost": 40,
"balance": 4250.5,
"enough": true,
"currency": "MWK"
}
}
| Field | Description |
data.recipients | How many different valid numbers the campaign would have. |
data.duplicates | How many repeated numbers would be left out. |
data.invalid_count | How many numbers are not valid. |
data.pages | How many SMS pages the campaign would use (a page is 160 characters). |
data.cost | What it would cost, in MWK, at today's prices. |
data.balance | Your balance now, in MWK. |
data.enough | false when your balance would not cover it; short_by says how much is missing. |