Your SMS balance, to check before a large send.
https://telcomw.com/api/v3/account/balanceYour API key goes in the X-API-Key header. There are no parameters.
| 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. |
curl --location --request GET 'https://telcomw.com/api/v3/account/balance' \ --header 'X-API-Key: YOUR_API_KEY'
curl --location --request GET "https://telcomw.com/api/v3/account/balance" ^ --header "X-API-Key: YOUR_API_KEY"
<?php
$headers = [
'X-API-Key: YOUR_API_KEY',
];
$ch = curl_init('https://telcomw.com/api/v3/account/balance');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
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: 'get',
url: 'https://telcomw.com/api/v3/account/balance',
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}).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'
}
response = requests.request('GET', 'https://telcomw.com/api/v3/account/balance', headers=headers)
print(response.json())
The response is JSON.
{
"success": true,
"request_id": "req_5f2c9a1d0e7b4a63",
"data": {
"balance": 4250.5,
"currency": "MWK",
"low_balance": false,
"sms_available": true
}
}
| Field | Description |
data.balance | Your balance in MWK. |
data.low_balance | true when the balance is low and you should top up. |
data.sms_available | false when sending is switched off for everybody. Messages sent then are not delivered and are not charged. |