Skip to main content

Account balance

Account balance is for WebRTC apps.

Each API request in TeleCMI platform includes App id and secret. Get your App id and secret in CHUB dashboard. After getting the app id and secret, make a POST request to the below base URL to retrieve the call balance, WhatsApp balance, SMS balance and expiry date of your app.

Base URL​

Send your POST method request with valid parameters, to the following base URL.

https://rest.telecmi.com/v3/balance

Required Parameters​

These are the required POST method parameters with description

Parameter NameTypeDescription
appidnumberYour app ID
secretstringYour app secret
Note
All the above parameters are mandatory.

Sample JSON Request​

Below is the following sample JSON POST method request

{
"appid": 1111113,
"secret": "xxxx-xxxx-xxxx-xxxx"
}

Sample Response​

If the provided information is valid, your web server will get a sample response from TeleCMI Platform as given below

{
"code": 200,
"expire": 1635921536108,
"balance": 1765,
"whatsapp": 242.04,
"sms": 100
}

Properties​

These are the list of properties and its description

PropertyTypeDescription
expirenumberThe expiry date in timestamp
balancenumberThe available call balance in inr or usd
whatsappnumberThe available WhatsApp balance. Returns 0 if no WhatsApp balance is set up for the app
smsnumberThe available SMS balance. Returns 0 if no SMS balance is set up for the app

HTTP status codes​

TeleCMI API platform represents the following status code to identity the errors.

Status codeStatus typeDescription
200OKWe received the request
404ErrorInvalid app id or secret, authentication failed
400ErrorParameter missing
500ErrorSomething went wrong while fetching the balance