Returns statistics for a Batch.


Returns statistics for a Batch.

Top ↑


array getBatchStatistics( string api_key, int batch_id );


api_key (string)

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

batch_id (int)

The ID of the Batch.

Return Value

Returns an associative array containing statistics for the Batch. See the remarks section below for the list of values this method returns.


$batch_id = 1234567;

$api        = new Api($url, 'YOURAPIKEY');
$statistics = $api->invokeMethod('getBatchStatistics', $batch_id);
    "id": 1,
    "method": "getBatchStatistics",
    "params": [
    "id": 1,
    "result": {
        "is_scheduled": 0,
        "send_time": 1362621313,
        "first_sent_time": 1362621338,
        "last_sent_time": 1362621338,
        "email_count": 32,
        "unsent_count": 32,
        "failed_count": 0,
        "gross_html": 3,
        "gross_plain": 0,
        "html_open_count": 3,
        "text_open_count": 0,
        "opened_count": 3,
        "not_opened_count": 29,
        "bounce_count": 0,
        "update_profile_count": 0,
        "unsubscribe_count": 0,
        "to_friend_count": 0,
        "unique_to_friend_count": 0,
        "unique_contact_click": 0,
        "unique_link_click": 0,
        "gross_click": 0,
        "deactivated_count": 0,
        "complained_count": 0,
        "send_status": "completed"
    "error": null


The following table shows the values that are returned.

Field Type Description
send_status string The send status of the batch
is_scheduled bool Whether this was a scheduled send
send_time int The time the batch was to be sent
first_sent_time int The time the batch was first sent
last_sent_time int The time the batch was last sent
email_count int The number of messages sent
unsent_count int The number of message that have not yet been sent
failed_count int The number of messages that failed to send
gross_html int Total HTML message opens
gross_plain int Total Plain Text message opens
html_open_count int Unique HTML message opens
text_open_count int Unique Plain Text message opens
opened_count int Total messages opened.
not_opened_count int Total Messages not opened.
bounce_count int Total number of bounces
update_profile_count int Total contacts that updated their profile
unsubscribe_count int Total contacts that unsubscribed
to_friend_count int Total number sent to friends
unique_contact_click int Number of contacts that clicked a link
unique_link_click int Total number of unique link clicks by contacts
gross_clicks int Total number of link clicks
deactivated_count int Total number of deactivations
complained_count int Total number of complaints

Error Codes

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

Code Error Description
308 Unable to load Batch The system could not load batch_id.

See Also