Get a collection of all email campaigns that are associated with your account.

Make a GET call to the /emails endpoint to get a list of all your email campaigns and details about each email campaign. The following provides sample data and lists the email campaign details that the GET call returns.

  • campaign_id: fa342848-edb6-477e-914d-f93c99c7a749
  • created_at: 2018-11-15T19:15:02.000Z
  • current_status: Draft
  • name: December Dog Lover Campaign
  • type: Newsletter
  • updated_at: 2018-11-15T19:15:14.000Z

Email campaigns are listed according to the updated_at timestamp; from most recent to least recent.

Make a GET call to the /emails/{campaign_id} endpoint to get details about a single email campaign and to get a list of all associated campaign activities; including the unique campaign_activity_id and the role that is associated with the activity.

Authorization Requirements

To use this GET call requires having the campaign:read user privilege and the campaign_data authorization scope.

Parameters

Use the limit parameter to specify the number of email campaigns that you want to return per page of output (from 1-500). The default is set to return 50 email campaigns per page.

If no email campaigns exist for your account, the API returns a successful 200 response code and an empty array. If you enter a value that exceeds the page limit of 500, this method returns a 400 error response.

Query Parameters

This method does not currently support filtering results using the email campaign updated_at timestamp.

Example GET Request

GET https://api.cc.email/v3/emails/

Endpoint Requirements

User privileges: campaign:read

Authorization scopes: campaign_data

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/emails');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Postman-Token' => '369450a1-2f98-4221-804a-fc08803a7e64',
  'cache-control' => 'no-cache',
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access_token}'
));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
curl -X GET \
  https://api.cc.email/v3/emails/ \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: d1b33fcc-fab8-43f8-9b37-b57b518a3151' \
  -H 'cache-control: no-cache'

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cc.email/v3/emails")
  .get()
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("Content-Type", "application/json")
  .addHeader("cache-control", "no-cache")
  .addHeader("Postman-Token", "199b2630-1f5d-4fc0-bb31-692fa98e157f")
  .build();

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

Response

{
    "campaigns": [
        {
            "campaign_id": "fa342848-edb6-477e-914d-f93c99c7a749",
            "created_at": "2018-11-15T19:15:02.000Z",
            "current_status": "Draft",
            "name": "Untitled Campaign Created 2018/11/15, 2:15:02 PM",
            "type": "Newsletter",
            "updated_at": "2018-11-15T19:15:14.000Z"
        },
        {
            "campaign_id": "8abde070-419a-4575-ac44-4b1ed00fa3c9",
            "created_at": "2018-06-18T14:20:54.000Z",
            "current_status": "Draft",
            "name": "Testing Segmentation",
            "type": "Newsletter",
            "updated_at": "2018-06-18T14:20:54.000Z"
        },
        {
            "campaign_id": "073da1d2-993a-4de2-990f-9b4067037979",
            "created_at": "2018-06-13T14:17:07.000Z",
            "current_status": "Removed",
            "name": "Test Email",
            "type": "Newsletter",
            "updated_at": "2018-06-13T14:20:29.000Z"
        }
    ]
}

Try it!