getBatchStatus

Returns details about the current status of a Batch.

getBatchStatus

Returns details about the current status of a Batch.

Top ↑

Syntax

array getBatchStatus ( string api_key, int id );

Parameters

api_key (string)

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

id (int)

The Batch ID.

Return Value

Returns an associative array containing information on the current status of the Batch. See the remarks section below for the list of values this method returns.

Examples

$batch_id = 1234567;
$api      = new Api($url, 'YOURAPIKEY');
$status   = $api->invokeMethod('getBatchStatus', $batch_id);
{
    "id": 1,
    "method": "getBatchStatus",
    "params": [
        "YOURAPIKEY",
        1234567
    ]
}
{
    "id": 1,
    "result": {
        "send_contact_count": "32",
        "send_current_count": "32",
        "is_scheduled": "0",
        "send_status": "completed"
    },
    "error": null
}

Remarks

The following table shows the values that are returned.

Key Type Description
send_contact_count int The total number of Contacts being sent to as part of this Batch
send_current_count int The number of Messages that have been sent so far
is_scheduled bool Value indicating if the Batch is a scheduled send
send_status string The current status of the Batch. Valid values are initialising, pending, sending completed, failed, cancelled or paused

Error Codes

This method may return the following error code in addition to the standard error codes:

Code Error Description
308 Unable to load the batch batch_id is not included or is not correct

See Also