Tutorials

SENDING SMS

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:

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

For 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"
}
				
			

For 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