getBatchById

Returns details for a specific Batch.

getBatchById

Returns details for a specific Batch.

Top ↑

Syntax

array getBatchById( string api_key, int batch_id );

Parameters

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 array containing a single associative array of Batch details. See searchBatches for a description of the values returned.

Examples

$batch_id = 287394;

$api = new Api($url, 'YOURAPIKEY');
$batch_details = $api->invokeMethod('getBatchById', array($batch_id));
{
    "id": 1,
    "method": "getBatchById",
    "params": [
        "YOURAPIKEY",
        287394
    ]
}
{
    "id": 1,
    "result": [
        {
            "id": "287394",
            "list_id": "315847",
            "creator_user_id": "25907",
            "creation_time": "1362621303",
            "message_id": "895730",
            "message_type": "email",
            "is_scheduled": "0",
            "is_populated": "1",
            "send_status": "completed",
            "send_time": "1362621313",
            "first_sent_time": "1362621338",
            "last_sent_time": "1362621338",
            "send_contact_count": "32",
            "send_current_count": "32",
            "is_test": "0",
            "type": "manual",
            "creator_name": "Lee Le"
        }
    ],
    "error": null
}

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 batch_id is not a valid Batch

See Also