Skip to content

EasySendSMS/EasySendSMS-CheckBalance-HTTPs-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

SMS Balance HTTP(s) API

This page provides a comprehensive reference for all features available via the HTTP interface for querying your balance.

The HTTP API allows you to integrate your system (client) with EasySendSMS using HTTP or HTTPS protocols to request and check your account balance securely using SSL encryption.

The client issues either a GET or POST request to the EasySendSMS HTTP API, supplying the required parameters. Our system responds with a text-format HTTP response that indicates the account balance.

This API call retrieves the current credit balance in your account.

API Base URL

https://api.easysendsms.app/balance

Method: GET, POST

Required Parameters

The following parameters must be included in your API request:

Parameter Description Required
Username Your EasySendSMS username. Yes
Password Your EasySendSMS account password or your API password (if set in your account settings). Yes

HTTP Response

The HTTP response from our system will contain the following information:

Response Format

If the balance request is successful, the response will contain your account balance.

Example:

1000 (Balance)

If the balance query fails, the response will return ERROR: {Error code}.

Example:

1002

Example GET Request

Below is an example of a GET request using the HTTP interface:

(Ensure all parameter values are URL-encoded)

Request URL:

https://api.easysendsms.app/balance?username=testuser&password=secret

Output:

1000 (Balance)

API Rate Limit

To maintain a high quality of service, EasySendSMS API enforces rate limits for its balance query API.

The default request rate limit is 2 requests per minute per account per IP address. The API will reject requests exceeding this limit with a 429 Too Many Requests HTTP status.

You can retry the request after 60 seconds.

API Error Codes

The following table outlines possible error codes you may encounter:

Code Description
1001 Invalid username or password. This indicates the parameter was not provided or was left blank.
1002 Authentication failed.
1007 Inactive or expired demo account.

Call the API with Code

Use the following examples to call the API from different programming languages:

🟒 .NET

Direct Link to Example

var options = new RestClientOptions("")
{
    MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("https://api.easysendsms.app/balance", Method.Post);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("username", "username");
request.AddParameter("password", "password");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);   

🐘 PHP

Direct Link to Example

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.easysendsms.app/balance',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => 'username=username&password=password',
    CURLOPT_HTTPHEADER => array(
        'Content-Type: application/x-www-form-urlencoded',
    ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

β˜• Java

Direct Link to Example

Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.easysendsms.app/balance")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("username", "username")
    .field("password", "password")
    .asString();

🐍 Python

Direct Link to Example

import http.client

conn = http.client.HTTPSConnection("api.easysendsms.app")
payload = 'username=username&password=password'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/balance", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

About

This API endpoint allows you to securely retrieve your current EasySendSMS account balance in real time. It can be used to monitor available credits before sending messages, automate balance checks, and ensure uninterrupted SMS delivery through your integrated systems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors