Get tracking activity details

Use the /reports/contact_reports/{contact_id}/activity_details endpoint to retrieve a list of campaign tracking activities with which a specific contact interacted.

Campaign Tracking Activities

Details about the following campaign tracking activities can be requested:

Emails

  • em_sends
  • em_opens
  • em_clicks
  • em_bounces
  • em_optouts
  • em_forwards

Landing Pages

  • p_contact_open
  • p_contact_click
  • p_contact_add
  • p_contact_update

Query Parameters

Required query parameters include:

  • tracking_activity_type or tracking_activities_list: The tracking activity type to return in the results using one of the following mutually exclusive query parameters:
    • tracking_activity_type allows you to choose the tracking activity types as an array (tracking_activity_type=em_sends&tracking_activity_type=em_opens)
    • tracking_activities_list allows you to choose the tracking activity types as a comma-delimited string (em_clicks, em_opens).

Optional query parameters include:

  • include_campaign_activity_names: Use to return campaign activity names in the results. The default setting is true . It is more efficient to not including campaign activity names in the results (false).
  • limit: Use to limit the number of tracking activities to return in a single page. Valid values are 1 to 100. The default setting is 100.

Example GET Request

GET https://api.cc.email/v3/reports/contact_reports/{contact_id}/activity_details

Endpoint Requirements

User privileges: ui:campaign:metrics

Authorization scopes: contact_data

The code examples below demonstrate how to pass a list of activity types in the tracking_activities_list query parameter as well as how to use the limit query parameter.

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/reports/contact_reports/{contact_id}/activity_details');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'tracking_activities_list' => 'em_sends,em_clicks',
  'limit' => '25'
));

$request->setHeaders(array(
  'Accept' => 'application/json',
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access_token}',
  'Cache-Control' => 'no-cache'
));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
curl -X GET \
  'https://api.cc.email/v3/reports/contact_reports/{contact_id}/activity_details?tracking_activities_list=em_sends,em_clicks&limit=25' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Cache-Control: no-cache'
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cc.email/v3/reports/contact_reports/{contact_id}/activity_details?tracking_activities_list=em_sends,em_clicks&limit=25")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("Cache-Control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

Example GET Response

{
  "tracking_activities": [
    {
      "contact_id": "71600990-908b-11e6-907f-00166bff25",
      "campaign_activity_id": "010a0-1234-5678-9012-1100a0c1ab2a",
      "campaign_activity_name": "My Campaign Created 2016/12/16, 2:59:56 PM",
      "created_time": "2017-04-02T04:08:00.000Z",
      "tracking_activities_list": "em_sends"
    },
    {
      "contact_id": "71600990-908b-11e6-907f-00166bff25",
      "campaign_activity_id": "010a0-1234-5678-9012-1100a0c1ab2a",
      "campaign_activity_name": "My Campaign Created 2016/12/16, 2:59:56 PM",
      "created_time": "2017-04-02T05:11:34.000Z",
      "tracking_activities_list": "em_clicks"
    }
  ],
  "_links": {
    "next": {
      "href": "string"
    }
  }
}

Try it!