REST API: GET impressions (Publisher)

Each emailing is tracked, which allows Copernica to provide you with emailing statistics. Impressions are one of these statistics. You can retrieve all impressions by sending an HTTP GET call to the following URL:

This method also support the use of the fields parameter for the ID and timestamp field.

Returned fields

The method returns a JSON object with several impressions stored in the 'data' field. For each impression the following information is available:

  • ID: The ID of the impression.
  • timestamp: The timestamp of the impression.
  • ip: The IP from which the impression came.
  • useragent: The user agent string of the user the impression came from.
  • device: The type of device the impression came from ('desktop','tablet','mobile','unknown').
  • referer: The referer of the user the impression came from.
  • emailing: The ID of the mailing.
  • destination: The ID of the destination.
  • profile: The ID of the profile.
  • subprofile: The ID of the subprofile (if applicable).

JSON example

The JSON representation of a single impression might look somewhat like this:

   "timestamp":"2010-07-20 14:34:32",
   "useragent":"Microsoft Outlook 2007, WinXP",

PHP example

This script demonstrates how to use this API method:

// dependencies

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// set the period
$parameters = array(
    'fields'    =>  array('timestamp>2019-01-01', 'timestamp<2019-02-01')

// execute the call
print_r($api->get("publisher/impressions/", $parameters));

This example requires the REST API class.

More information