Vision 6

getBatchLinkStatistics

Returns a list of statistics for all links in a Batch.

getBatchLinkStatistics

Returns a list of statistics for all links in a Batch.

Top ↑

Syntax

array getBatchLinkStatistics( string api_key, int batch_id );

API Key Access Level required: Standard access

Parameters

api_key (string)

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

batch_id (int)

The Batch ID

Return Value

Returns an array containing zero or more associative arrays of link statistics. See the remarks section below for the list of values this method returns.

Examples

PHP

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

$batch_id = 1414651;
$link_statistics= $api->invokeMethod('getBatchLinkStatistics', $batch_id);

JSON Request

{
    "id": 1,
    "method": "getBatchLinkStatistics",
    "params": [
        "YOURAPIKEY",
        1414651
    ]
}

JSON Response

{
    "id": 1,
    "result": [
        {
            "link_id": 123,
            "link_name": "Example Website",
            "link_url": "http:\/\/www.example.com",
            "click_count": "2",
            "contact_count": "2"
        },
        {
            "link_id": 211,
            "link_name": "Example2 Website",
            "link_url": "http:\/\/www.example2.com",
            "click_count": "1",
            "contact_count": "1"
        }
    ],
    "error": null
}

Remarks

The following table shows the values that are returned.

Key Type Description
link_id int The link ID
name string The link Name
link_url string The link URL
click_count int The total number of times the link was clicked
contact_count int The total number of Contacts that clicked the link

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 valid

See Also