Account Balance

SMS V3 APIs

Your SMS balance, to check before a large send.

GEThttps://telcomw.com/api/v3/account/balance

Your API key goes in the X-API-Key header. There are no parameters.

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.

Example request

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())

Response

The response is JSON.

Response (200)

{
  "success": true,
  "request_id": "req_5f2c9a1d0e7b4a63",
  "data": {
    "balance": 4250.5,
    "currency": "MWK",
    "low_balance": false,
    "sms_available": true
  }
}

Fields explained

FieldDescription
data.balanceYour balance in MWK.
data.low_balancetrue when the balance is low and you should top up.
data.sms_availablefalse when sending is switched off for everybody. Messages sent then are not delivered and are not charged.