Our v3 API is now available! Learn more by visiting the v3 developer portal. Creating new v2 API keys is no longer supported.

Email Campaign Collections

Use this end point to retrieve (GET) the collection of existing email campaigns, or to create (POST) a new email campaign.

Methods:

Click a method to view its documentation

GET POST

DescriptionTOP

Privileges required: campaign:list

Retrieves the email campaigns in a user's account as follows:

  • all campaigns in the user's account (no query parameter specified)
  • campaigns with the status specified using the status query parameter; see the parameter table below for status types and definitions
  • campaigns modified on or after the date/time specified using the modified_since query parameter. This is useful for syncing email campaigns across applications.

Campaign sort order depends on the campaign status:

Status Campaign sort order
DRAFT by the latest modified_date
SENT by the latest last_run_date
SCHEDULED    by the next_run_date
DELETED by the latest last_run_date if it was sent, or by the latest modified_date, if it was never sent

About DELETED campaigns

Deleted campaigns are included in a GET response only when status=DELETED query parameter is used. They  are not included in the GET collection by default. You cannot retrieve an individual deleted campaign object using the API.

DescriptionTOP

Privileges required: campaign:read

Retrieves the email campaign message specified by the campaignId path parameter. The tracking_summary data is current as of the last scheduled update, unless you set updateSummary=true to return updated data.

NOTE: Details of a deleted campaign cannot be retrieved. If a call is made to GET a deleted campaign by its ID, the call will fail and return a 404 Not Found response. You can login to the account to restore the campaign and then retrieve its details.

DescriptionTOP

Privileges required: campaign:read

Retrieve a preview of an existing email marketing campaign (specify using required campaignId path parameter). The preview includes both the text version and the rendered HTML version of the email campaign so the user can verify how the campaign will appear to recipients.

As with the campaign testsend endpoint, any content that is customized for each recipient using variables in the campaign and custom fields in the contact records is not processed in a campaign preview.

DescriptionTOP

Privileges required: mylibrary:file:read

Retrieve a list of MyLibrary folders and their properties for the authorized Constant Contact account. MyLibrary supports a folder hierarchy with 3 levels of nesting. Primary, child (2nd level) and grandchild (3rd level) folders all have the same properties associated with them. This endpoint returns an empty results array if there are no folders in the user's account.

DescriptionTOP

Privileges required: mylibrary:file:read

The following options  are available when retrieving Library files:

  • Retrieve all files in all folders in the account - do not use any query parameters (except for api_key)
  • Retrieve all files with a specific type - use the type query parameter (ALL, IMAGE, or Document)
  • Retrieve all files from a specific source - use the source query parameter
  • Retrieve a specific file type from a specific source - use both the type and source query parameters

There are many options available for sorting the JSON response using the sort_by query parameter.

DescriptionTOP

Privileges required: campaign:read

Retrieve a list of all items for an event specified using the eventId path parameter.

DescriptionTOP

Privileges required: campaign:read

Retrieve the collection of all registrants for the event specified using the event_id path parameter. 

DescriptionTOP

Privileges required: campaign:read

Retrieve all promocodes for an event specified by the eventId path parameter.

DescriptionTOP

Privileges required: campaign:read

Retrieve all fees for the event specified by the event_id path parameter. 

DescriptionTOP

Privileges required: campaign:list

Retrieve all events in a user's account.

GET: https://api.constantcontact.com/v2/emailmarketing/campaigns

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

limit

query

50

Specifies the number of results displayed per page of output, from 1 - 50, default = 50. See Paginated Output for more information on using limit.

modified_since

query

Use to retrieve only email campaigns that were modified on or after the date/time specified in ISO-8601 format.

status

query

ALL

Returns list of email campaigns with specified status - valid values:

  • ALL: Default, returns all campaigns
  • DRAFT: Email campaign is in draft stage, is not scheduled, and can still be edited
  • RUNNING: The email message is in the process of being sent and cannot be edited
  • SENT: The email message has been sent to recipients, and cannot be edited
  • SCHEDULED: The email messages has been scheduled to be sent out on a specific date and cannot be edited unless it's returned to Draft status

Response CodesTOP

code

description

200

Request was successful

401

Authentication failure

404

Email campaign(s) not found

406

Unsupported accept header value; must be application/json

500

Internal server error occurred

Response StructureTOP

property

type(max length)

description

Example ResponseTOP

{
    "meta": {
        "pagination": {
            "next_link": "/v2/emailmarketing/campaigns?next=cGFnZU51bT0yJnBhZ2VTaXplPTI"
        }
    },
    "results": [
        {
            "id": "1100395494220",
            "name": "1357157252225",
            "status": "SENT",
            "modified_date": "2013-01-07T18:51:35.975Z"
        },
        {
            "id": "1100395673356",
            "name": "Update1357593398565",
            "status": "DRAFT",
            "modified_date": "2013-01-07T16:16:43.768Z"
        }
        ]
}