Syntax
array getBatchLinkStatistics ( 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 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
$api = new Api($url, 'YOURAPIKEY');
$batch_id = 1414651;
$link_statistics= $api->invokeMethod('getBatchLinkStatistics', $batch_id);
$batch_id = 1414651;
$link_statistics= $api->invokeMethod('getBatchLinkStatistics', $batch_id);
{
"id": 1,
"method": "getBatchLinkStatistics",
"params": [
"YOURAPIKEY",
1414651
]
}
"id": 1,
"method": "getBatchLinkStatistics",
"params": [
"YOURAPIKEY",
1414651
]
}
{
"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
}
"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 |