Get a list of contacts that opened the email campaign activity.

For primary_email and resend role email campaign activities, make a GET call to the /reports/email_reports/{campaign_activity_id}/opens endpoint to get a list of contacts that opened a specified email campaign activity. The resulting opens report lists each time each contact opened the email campaign activity, with the most recent opens report listed first.

The opens report data includes basic contact information, such as the contact’s email address and unique ID, the date and time they opened the email campaign activity, and the type of device used to open it. For example:

{
  "contact_id": "439a1cb0-5b89-11e7-ba80-00163e498a38",
  "campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
  "tracking_activity_type": "em_opens",
  "email_address": "jake_dodge@jakedodgepancakes.com",
  "device_type": "mobile",
  "created_time": "2019-05-16T21:14:00.000Z"  
}

If you have not sent the email campaign activity to any contacts, this method returns a 200 response code and an empty array for tracking_activity:

{
   "campaign_activity_id": "6cc0d637-cf3d-4ac6-aad7-21567698eb38",
   "tracking_activities": []
}    

You can confirm that Constant Contact successfully sent an email campaign activity by making a GET call to /emails/activities/{campaign_activity_id} and checking that the email campaign activity has a status of Done. For more information, see the Get an Email Campaign Activity topic.

Parameters

This method requires the campaign_activity_id URL parameter of the email campaign activity for which you want to get an email opens report. Optionally, you can choose to limit the number of email opens to return on each page by using the limit query parameter.

Query Parameters

This method does not currently support filtering results using the email opens report created_time timestamp.

Example Get Email Opens Report Call

This example GET call returns an email opens report for a specified email campaign activity and limits the number of email opens activities to return to three per page.

GET https://api.cc.email/v3/reports/email_reports/cc8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/opens?limit?=3

Endpoint Requirements

User privileges: ui:campaign:metrics

Authorization scopes: campaign_data

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/reports/email_reports/cc8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/opens?limit=3');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Connection' => 'keep-alive',
  'Accept-Encoding' => 'gzip, deflate',
  'Host' => 'host_name.com',
  'Postman-Token' => '8b7539ed-761f-40b3-b2b3-f637244d8461,7afefe18-71ce-47ac-9832-2c31fb300566',
  'Cache-Control' => 'no-cache',
  'Accept' => '*/*',
  'User-Agent' => 'PostmanRuntime/7.15.2',
  'Authorization' => 'Bearer {access_token}',
  'a' => '',
  'Content-Type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cc.email/v3/reports/email_reports/cc8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/unique_opens?limit=3")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("a", "")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("User-Agent", "PostmanRuntime/7.15.2")
  .addHeader("Accept", "*/*")
  .addHeader("Cache-Control", "no-cache")
  .addHeader("Postman-Token", "8b7539ed-761f-40b3-b2b3-f637244d8461,51b0c223-1fb0-40a6-a5a8-17cdc6713d5a")
  .addHeader("Host", "host_name.com")
  .addHeader("Accept-Encoding", "gzip, deflate")
  .addHeader("Connection", "keep-alive")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
curl -X GET \
  https://api.cc.email/v3/reports/email_reports/cc8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/opens?limit=3 \
 \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: host_name.com' \
  -H 'Postman-Token: 8b7539ed-761f-40b3-b2b3-f637244d8461,0d71b163-ca10-4871-8ef5-ac8cedb2dbac' \
  -H 'User-Agent: PostmanRuntime/7.15.2' \
  -H 'a: ' \
  -H 'cache-control: no-cache'

Response

{
    "tracking_activities": [
        {
            "contact_id": "4399ce90-5b89-11e7-ba80-00163e498a38",
            "campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
            "tracking_activity_type": "em_opens",
            "email_address": ""jake_dodge@jakedodgepancakes.com",
            "device_type": "other",
            "created_time": "2019-05-16T21:14:00.000Z"
        },
        {
            "contact_id": "4399f5a0-5b89-11e7-ba80-00163e498a38",
            "campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
            "tracking_activity_type": "em_opens",
            "email_address": "jake_dodge@jakedodgepancakes.com",
            "device_type": "mobile",
            "created_time": "2019-05-16T21:14:00.000Z"
        },
        {
            "contact_id": "439a1cb0-5b89-11e7-ba80-00163e498a38",
            "campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
            "tracking_activity_type": "em_opens",
            "email_address": "jake_dodge@jakedodgepancakes.com",
            "device_type": "mobile",
            "created_time": "2019-05-16T21:14:00.000Z"
        }
    ],
    "_links": {
        "next": {
            "href": "https://api.cc.email/v3/reports/email_reports/c8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/opens?next=L2NhbXBhaWduLXR5cGUtZGF0ZS9jOGNkZjM4NC0xNWNhLTRkY2MtOWI2Zi00YzkxMTIxZmRjMjMvZV9vcGVuP2F0dHJpYnV0ZXM9Y29udGFjdElkJTJDY2FtcGFpZ25BY3Rpdml0eUlkJTJDZGV2aWNlVHlwZSUyQ2NyZWF0ZWRPbiUyQ2FjdGl2aXR5VHlwZSUyQ2VtYWlsJTJDYm91bmNlQ29kZSZsaW1pdD0zJm5leHQ9QUFnQUFBRnF3bjZod0FBQUVFT2FITEJiaVJIbnVvRUFGajVKaWpnQUFCQkRxTUt3VzRrUjU3cUdBQlklMkJTWW80QUFBQUFBJTNEJTNE"
        }
    }
}

Try it!