The balance of the SMS application, to check before a large send.
https://telcomw.com/api/v3/account/balanceThe API key of the SMS application goes in the X-API-Key header. There are no parameters.
| Parameter | Sent in | Required | Description |
X-API-Key |
header | YES | The API key of the SMS application, sent as a header. It starts with tmwapp_ and is made in the dashboard, under SMS Applications. It is not your account API key. |
curl --location --request GET 'https://telcomw.com/api/v3/account/balance' \ --header 'X-API-Key: YOUR_APPLICATION_KEY'
curl --location --request GET "https://telcomw.com/api/v3/account/balance" ^ --header "X-API-Key: YOUR_APPLICATION_KEY"
<?php
$headers = [
'X-API-Key: YOUR_APPLICATION_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_APPLICATION_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_APPLICATION_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": {
"application_id": "482913",
"name": "Shop website",
"balance": 1250.5,
"currency": "MWK",
"low_balance": false,
"sms_available": true
}
}
| Field | Description |
data.application_id | The number of the SMS application. |
data.name | The name of the SMS application. |
data.balance | The balance of the SMS application in MWK. The main balance of the account is never shown. |
data.low_balance | true when the balance is low and the application should be funded. |
data.sms_available | false when sending is switched off for everybody. Messages sent then are not delivered and are not charged. |