Skip to main content
Version: Next

Check Balance via the Comms API: Request & Response

The Pahappa Comms API provides a single JSON endpoint for checking your account balance. This page covers the request structure, authentication, and response format for the Balance method.

Endpoint

Send a POST request to the following URL with Content-Type: application/json:

POST https://comms.egosms.co/api/v1/json/
Content-Type: application/json

Quick example

Replace YOUR_USERNAME and YOUR_PASSWORD with your credentials and run this to check your local wallet balance:

curl -X POST https://comms.egosms.co/api/v1/json/ \
-H "Content-Type: application/json" \
-d '{
"method": "Balance",
"userdata": {
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"
}
}'

Authentication

Include your API credentials inside the userdata object in every request. You can find your API username and API password in the Comms platform under Settings > API Settings.

Request fields

methodstringrequired

Must be "Balance".


userdataobjectrequired

Authentication credentials object.


userdata.usernamestringrequired

Your API username, copied from the platform under Settings > API Settings.


userdata.passwordstringrequired

Your API password, copied from the platform under Settings > API Settings.


walletTypestringdefault: Local

Which wallet to check the balance of. One of "Local" or "International". Omit the field entirely to check the local wallet — do not send it as null, that is rejected (see below).


Omit walletType, don't null it

If you include walletType in the request, its value must be "Local" or "International". Sending it explicitly as null is rejected with "walletType must either be Local or International" — to use the default, leave the field out of the JSON body entirely rather than sending a null value.

Request examples

Default (local) wallet

{
"method": "Balance",
"userdata": {
"username": "api_username",
"password": "api_key"
}
}

A specific wallet

{
"method": "Balance",
"userdata": {
"username": "api_username",
"password": "api_key"
},
"walletType": "International"
}

Response fields

Statusstring

"OK" on success, or "Failed" on error.


Balancenumber

Current credit balance of the requested wallet. Not always a whole number. This field only exists when the Status is "OK"


Messagestring

Human-readable status message. This field only exists when the Status is "Failed"


Response examples

Status=OK

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

Balance isn't always a whole number — it can come back fractional, for example "Balance": 96050530.5.

Status=Failed

{
"Status": "Failed",
"Message": "Wrong Username or Password."
}

Error handling

Failures still return HTTP 200

The API returns HTTP 200 OK even when a request fails. Do not rely on the HTTP status code — always check the Status field in the response body, and treat "Failed" as an error.

If Status is "Failed", the Message field contains the reason for the failure. For a full list of error codes and troubleshooting guidance, see the Error Handling page.

Next steps