Messente logo

Account Balance API

Checking your account balance in Messente

Using the Messente Account Balance API you can:

  • Receive a response with your current account balance. In case of failed request the response will return with error that indicates the reason why the request failed.

HTTP GET/POST Request URL:

http(s)://api2.messente.com/get_balance/

Backup balance API endpoint URL:

http(s)://api3.messente.com/get_balance/

Request parameters

Key Value
username API account user name from the Messente's web page
password API account security key (API key) from the Messente's web page

Response from get_balance request

Basic syntax for successful response: OK [SMS balance in EUR]

When the request was unsuccessful, the HTTP response includes one of the response codes:

Code Meaning
ERROR 101 Access is restricted, wrong credentials. Check username and password values.
ERROR 102 Parameters are wrong or missing. Check that all required parameters are present.
FAILED 209 Server failure, try again after a few seconds or try api3.messente.com backup server.

Example request

https://api2.messente.com/get_balance/?username=api_username&password=api_password

Successful response:

OK 707.54

Examples


import messente

api = messente.Messente(
	username="api_user",
	password="api_password"
)

response = api.credit.get_balance()
if response.is_ok():
	print("Account balance:", response.get_result())
else:
	print(response.get_full_error_msg())