getCreditBalance

Returns the credit balance of the Account.

getCreditBalance

Returns the credit balance of the Account.

Top ↑

Syntax

array getCreditBalance( string api_key, string credit_type );

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

credit_type (string)

The credit type to get the balance for. Valid values are:

  • sms
  • email_test

Return Value

Returns an array containing the credit balance of the account.

Key Description
type The credit type. Valid values are
sms
email_test
credits The amount of existing credits available
post_paid The amount of post paid credits available

Examples

$api = new Api($url, 'YOURAPIKEY');

$result = $api->invokeMethod('getCreditBalance', 'email_test');
{
    "id": 1,
    "method": "getCreditBalance",
    "params": [
        "YOURAPIKEY",
        "email_test"
    ]
}
{
    "id": 1,
    "result": [
        {
            "type": 'email_test',
            "credits": 0,
            "post_paid": 90
        }
    ],
    "error": null
}

See Also