Check Balance API

The following sections describe the request URL to get balance SMS information using AYOSMS! SMS API and all of its associated input parameters and their corresponding values.

Endpoint URL

All the requests to AYOSMS! must be submitted to following Endpoint URL:

https://api.ayosms.com/mconnect/gw/balance.php

Input Parameters

The following table lists each parameter that can be submitted together with the Endpoint URL given above. Note that the parameter is mandatory. Parameter is case sensitive.


Parameter Description Example Values
api_key Mandatory AYOSMS! account API Key. 11877c8e0ac231ca93ec2cfcbe1820eb

Send Respond

AYOSMS! SMS API returns a response in 2 parts:
  • HTTP Header Status (typically with a HTTP status code 200 OK to indicate successful API call)
  • HTTP Content (In JSON format)

Successful SMS Send Response

A standard successful SMS Send Response shall return status code as '1':
HTTP Header 200 OK
Content
{
balance : "100000",
currency : "IDR",
balance_expired : "2017-07-04 00:00:00",
status : 1
}

Error Response: Account Suspended

HTTP Header 200 OK
Content
{
balance : "",
currency : "",
balance_expired : "2017-07-04 00:00:00",
status : 0,
error-text : "ERR001:account suspended"
}

Response Attributes

Parameter Description
status Status code. '1' indicates Successful Request, while '0' for Unsuccessful Request (For Error codes, please refer to Error Response Code section below)
balance Account's SMS remaining balance.
currency Balance's currency (possible values: IDR/USD/MYR/SGD/EUR/CNY/JPY)
balance_expired Date time (GMT+7) when your credit balance is expired
error-text Error codes followed by error explanation

Error Response Code

Response Code Description
ERR001 account suspended
ERR999 api_key is empty

Example

To check account's remaining balance

https://api.ayosms.com/mconnect/gw/balance.php?api_key=your_unique_api_key
Parameter Value in Request Description
api_key your_unique_api_key Your AYOSMS! Account API Key
SMSMOO
AYOMOBILE!