Balance Inquiry Using JSON

Overview

This method provides a way to send check for the EgoSms balance using JSON.

Check balance by making an HTTP POSTĀ request to the following endpoints:

LIVE URL: https://www.egosms.co/api/v1/json/

SANDBOX URL: http://sandbox.egosms.co/api/v1/json/

JSON Balance Request Parameters

These are the standard request parameters that are needed when using the EgoSms Balance Inquiry JSON API.

methodString Required

Specifies the action being performed. ie Balance for Balance Inquiry.

usernameString Required

The account username.

passwordString Required

The account password.

Example

Submitted JSON

				
					{
   "method":"Balance",
   "userdata":{
      "username":"Egotest",
      "password":"xxxxxxxxxxx"
   }
}
				
			

System Feedback

A Successful Request

Once the request has been successfully submitted, it will return the balance of the account in Json format as shown below.

				
					{
   "Status":"OK",
   "Balance":"1380"
}
				
			

A Failed Request

Once the request fails, JSONĀ in theĀ  format below will be returned.

				
					{
   "Status":"Failed",
   "Message":"xxxxxxx"
}
				
			

Possible Error Messages

Error

Meaning

Wrong Username or Password.

Occurs if either your username or password is wrong.

That user does not exist or user not active

Occurs if the account being used does not exist or isĀ  inactive or if the username is not set.

One Of The Values Is Empty

Occurs if any of the parameters is empty.

Method Of Request Not Set

Occurs if the method value is empty.

Programming Example