Make a GET call to the /emails
endpoint to get a list of all your email campaigns and details about each email campaign. Email campaigns in the response body are listed by most recent to least recent, according to the updated_at
timestamp.
The following provides descriptions and examples of the campaign properties returned in the response body.
-
campaign_id: fa342848-edb6-477e-914d-f93c99c7a749
The unique ID used to identify the email campaign (UUID format).
-
created_at: 2018-11-15T19:15:02.000Z
The system generated date and time that this email campaign was created, in ISO-8601 format.
-
updated_at: 2018-11-15T19:15:14.000Z
The system generated date and time that this email campaign was last updated, in ISO-8601 format.
-
current_status: Draft
The current status of the email campaign. Valid values include:
- Draft — An email campaign that you have created but have not sent to contacts.
- Scheduled — An email campaign that you have scheduled for Constant Contact to send to contacts.
- Executing — An email campaign that Constant Contact is currently sending to contacts. Email campaign activities are only in this status briefly.
- Done — An email campaign that you successfully sent to contacts.
- Error — An email campaign activity that encountered an error.
- Removed — An email campaign that a user deleted. Users can view and restore deleted emails through the UI.
-
name: December Dog Lover Campaign
The descriptive name the user provides to identify this campaign. Campaign names must be unique for each account ID.
-
type: NEWSLETTER
Identifies the type of campaign that you select when creating the campaign. Newsletter and Custom Code email campaigns are the primary types.
- Newsletter
- Custom Code Email
- Announcement
- Product/Service News
- Business Letter
- Card
- Press release
- Flyer
- Feedback Request
- Ratings and Reviews
- Event Announcement
- Simple Coupon
- Sale Promotion
- Product Promotion
- Membership Drive
- Fundraiser
-
type_code: 10
The code used to identify the email campaign
type
.- 1 (Default)
- 2 (Bulk Email)
- 10 (Newsletter)
- 11 (Announcement)
- 12 (Product/Service News)
- 14 (Business Letter)
- 15 (Card)
- 16 (Press release)
- 17 (Flyer)
- 18 (Feedback Request)
- 19 (Ratings and Reviews)
- 20 (Event Announcement)
- 21 (Simple Coupon)
- 22 (Sale Promotion)
- 23 (Product Promotion)
- 24 (Membership Drive)
- 25 (Fundraiser)
- 26 (Custom Code Email)
- 57 (A/B Test)
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.
Use the before_date
query parameter to return only email campaigns with last updated_at
timestamps that are before a specific date and time (in ISO-8601 format).
Use the after_date
query parameter to return only email campaigns with last updated_at
timestamps that are after a specific date and time (in ISO-8601 format).
Use both the before_date
and after_date
query parameters to get email campaigns with last updated_at
timestamps within a specific date range (in ISO-8601 format).
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.
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",
"type_code": "10",
"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",
"type_code": "10",
"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",
"type_code": "10",
"updated_at": "2018-06-13T14:20:29.000Z"
}
]
}