Application Balance

SMS V3 APIs - SMS Applications

The balance of the SMS application, to check before a large send.

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

The API key of the SMS application goes in the X-API-Key header. There are no parameters.

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.

Example request

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

Response

The response is JSON.

Response (200)

{
  "success": true,
  "request_id": "req_5f2c9a1d0e7b4a63",
  "data": {
    "application_id": "482913",
    "name": "Shop website",
    "balance": 1250.5,
    "currency": "MWK",
    "low_balance": false,
    "sms_available": true
  }
}

Fields explained

FieldDescription
data.application_idThe number of the SMS application.
data.nameThe name of the SMS application.
data.balanceThe balance of the SMS application in MWK. The main balance of the account is never shown.
data.low_balancetrue when the balance is low and the application should be funded.
data.sms_availablefalse when sending is switched off for everybody. Messages sent then are not delivered and are not charged.