getClicksInfo

Description

Get detailed clicks info for mailing lists. It will return several informations like:





Params

Name Type Description
apiKey string API key previously generated
id integer Optional parameter if you want to get stats for a single mailing list. If not set, will return for all mailing lists.
startDate string Optional parameter for start date. Must be in the following format: YYYY-MM-DD HH:MM:SS.
endDate string Optional parameter for end date. Must be in the following format: YYYY-MM-DD HH:MM:SS.

 

Returned data

Type: array

Description: Return array with clicks data.

 

Json sample code

<?php

$curl = curl_init('https://your_address/ccm/admin/api/version/2/&type=json');

$postData = array(
    'function' => 'getClicksInfo',
    'apiKey' => 'apiKey',
);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$json = curl_exec($curl);
if ($json === false) {
    die('Request failed with error: '. curl_error($curl));
}

$result = json_decode($json);
if ($result->status == 0) {
    die('Bad status returned. Error: '. $result->error);
}

var_dump($result->data);

 

Result of API call

Array
(
    [0] => stdClass Object
        (
            [date] => 2012-02-13 11:21:22
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 5
            [browser] => Chrome 16.0.912.77
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [1] => stdClass Object
        (
            [date] => 2012-02-13 11:21:10
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 4
            [browser] => Chrome 16.0.912.77
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [2] => stdClass Object
        (
            [date] => 2012-02-13 11:16:36
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 5
            [browser] => Internet Explorer 9.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1441
            [screen_height] => 810
            [location] => Catarroja - Comunidad Valenciana
        )

    [3] => stdClass Object
        (
            [date] => 2012-02-13 11:15:55
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 4
            [browser] => Internet Explorer 9.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1441
            [screen_height] => 810
            [location] => Catarroja - Comunidad Valenciana
        )

    [4] => stdClass Object
        (
            [date] => 2012-02-13 11:14:49
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 5
            [browser] => Firefox 10.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [5] => stdClass Object
        (
            [date] => 2012-02-13 11:14:46
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 4
            [browser] => Firefox 10.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [6] => stdClass Object
        (
            [date] => 2012-02-13 11:14:37
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 4
            [browser] => Firefox 10.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [7] => stdClass Object
        (
            [date] => 2012-02-13 10:55:20
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 3
            [browser] => Internet Explorer 9.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1441
            [screen_height] => 810
            [location] => Catarroja - Comunidad Valenciana
        )

    [8] => stdClass Object
        (
            [date] => 2012-02-13 10:55:12
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 2
            [browser] => Internet Explorer 9.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1441
            [screen_height] => 810
            [location] => Catarroja - Comunidad Valenciana
        )

    [9] => stdClass Object
        (
            [date] => 2012-02-13 10:53:25
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 2
            [browser] => Firefox 10.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [10] => stdClass Object
        (
            [date] => 2012-02-13 10:53:05
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 3
            [browser] => Firefox 10.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

    [11] => stdClass Object
        (
            [date] => 2012-02-13 10:52:49
            [email] => demo@mail.com
            [url] => http://www.demo.com
            [link_no] => 2
            [browser] => Firefox 10.0
            [os] => Windows
            [lat] => 39.4000015259
            [lng] => -0.40000000596
            [screen_width] => 1366
            [screen_height] => 768
            [location] => Catarroja - Comunidad Valenciana
        )

)
Menu Title