Loader

Retrieve account balance


Overview

This command will return the number of credits available on your account.

If you simply want to monitor your account balance, you can receive SMS and email notifications when your account balance reaches a certain amount. This can be configured within your Developers Central account.


Command
https://api.clickatell.com/http/getbalance?user=xxxx&password=xxxx&api_id=xxxx

Parameters

You need to supply the authentication parameters that are outlined here


Examples

Bash

1
2
3
4
5

username="place username here"
password="place password here"
api_id="place password here"
curl --data "user=$username&password=$password&api_id=$api_id" \
    'https://api.clickatell.com/http/getbalance'

PHP

1
2
3
4
5
6
7
8

<?php
$username = urlencode("place username here");
$password = urlencode("place password here");
$api_id   = urlencode("place api_id here");
 
echo file_get_contents("https://api.clickatell.com/http/getbalance"
   "?user=$username&password=$password&api_id=$api_id");
?>

Python

1
2
3
4
5
6
7
8
9
10
11

import urllib2, urllib
 
params = {
    "user""place username here",
    "password""place password here",
    "api_id""place password here"
}
 
params = urllib.urlencode(params)
= urllib2.urlopen("https://api.clickatell.com/http/getbalance", params)
print f.read()


API responses

Example response


Successful API response:

Credits: 123.00
 

Error response:

ERR: 001, Authentication failed

Format

Successful API response:

Credits: <balance>
 

Error response:

ERR: <error code>, <error description>

Did you find this information informative?

Other Resources

Ask the Community

Visit Stack Overflow to join our community of developers and find the answer you need

Contact Support

Contact our support team and one of our agents will be in touch with you to answer any questions you have