How to retrieve open and click rates

Use the /reports/contact_reports/{contact_id}/open_and_click_rates endpoint to retrieve open and click rates for a specific contact.

The endpoint requires two query parameters, start and end, that define a date range for the report. The start and end query parameters must be provided in ISO 8601 format. For example: 2018-08-16T12:30:00Z. The date range cannot exceed five years from start to end.

Example GET Request


Endpoint Requirements

User privileges: ui:campaign:metrics

Authorization scopes: contact_data


$request = new HttpRequest();

  'start' => '2018-01-01T00:00:00.000Z',
  'end' => '2018-08-09T00:00:00.000Z'

  '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 \
  '{contact_id}/open_and_click_rates?start=2018-01-01T00:00:00.000Z&end=2018-08-09T00:00:00.000Z' \
  -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()
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("Cache-Control", "no-cache")

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

Example GET Response

  "contact_id": "71600990-908b-11e6-907f-00166bff25",
  "included_activities_count": 10,
  "average_open_rate": 0.6,
  "average_click_rate": 0.6

Try it!