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

Individual Email Campaign

Use this endpoint to retrieve (GET), update (PUT), or DELETE an existing email marketing campaign. To create a new email campaign message, use the POST method for the Email Campaign Collection API.

Methods:

Click a method to view its documentation

GET PUT DELETE

DescriptionTOP

Retrieve a specific partner webhook topic by specifying the topicId path parameter. See the available topic ID's here.

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: contacts:lists:read

GET a specific contact list (specified using the listId path parameter).

DescriptionTOP

Privileges required: mylibrary:folder:read

Retrieve a specific MyLibrary folder using the folderId path parameter. 

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 MyLibrary file using the fileId path parameter.

DescriptionTOP

Privileges required: campaign:read

Retrieve an event item by using the eventId and itemId path parameters to specify the event and item. 

DescriptionTOP

Privileges required: campaign:read

Get a specific event object (specified by the event_id path parameter). Properties with a null value are not returned in the JSON response.

DescriptionTOP

Privileges required: campaign:read

Retrieve detailed information about a specific registrant (specified by registrantId) for an event (specified by eventId).

GET: https://api.constantcontact.com/v2/emailmarketing/campaigns/{campaignId}

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

campaignId

path

Specifies the email campaign message to retrieve (GET)

updateSummary

query

false

Set this to true to retrieve current tracking_summary data, otherwise data is current as of last scheduled update

Response CodesTOP

code

description

200

Request was successful

401

Authentication failure

404

Campaign not found for campaign id

406

Unsupported Accept Header value, must be application/json

500

Internal server error occurred

StructureTOP

property

type(max length)

description

Example ResponseTOP

{
    "id": "1234567890123",
    "name": "Campaign Name",
    "subject": "Campaign Subject",
    "from_name": "My Organization",
    "from_email": "fromemail@example.com",
    "reply_to_email": "replytoemail@example.com",
    "template_type": "CUSTOM",
    "created_date":"2012-02-09T11:07:43.626Z",
    "modified_date": "2012-02-10T11:07:42.626Z",
    "last_run_date": "2012-02-10T11:07:43.626Z",
    "next_run_date": "2012-02-11T11:07:43.626Z",
    "permalink_url": "http://myemail.constantcontact.com/Campaign-Subject.html?soid=1100325770405&aid=pXOr2wq4W5U",
    "status": "SENT",
    "permission_reminder_text": "Hi, just a reminder that you're receiving this email because you have expressed an interest in MyCompany. Don't forget to add from_email@example.com to your address book so we'll be sure to land in your inbox. You may unsubscribe if you no longer wish to receive our emails.",
    "view_as_web_page_text": "View this message as a webpage",
    "view_as_web_page_link_text": "Click here",
    "greeting_salutations": "Hello",
    "greeting_name": "FIRST_NAME",
    "greeting_string": "Dear",
    "email_content": "<html><body><p>This is text of the email message.</p></body></html>",
    "text_content": "This is the text of the email message.",
    "email_content_format": "HTML",
    "style_sheet": "",
    "message_footer": {
        "organization_name": "My Organization",
        "address_line_1": "123 Maple Street",
        "address_line_2": "Suite 999",
        "address_line_3": " ",
        "city": "Anytown",
        "state": "MA",
        "international_state": "",
        "postal_code": "01245",
        "country": "US",
        "include_forward_email": true,
        "forward_email_link_text": "Click here to forward this email",
        "include_subscribe_link": true,
        "subscribe_link_text": "Subscribe to Our Newsletter!"
    },
    "tracking_summary": {
        "sends": 1363,
        "opens": 789,
        "clicks": 327,
        "forwards": 39,
        "unsubscribes": 0,
        "bounces": 12,
        "spam_count": 6
    },
    "sent_to_contact_lists": [
        {
            "id": "1"
        }
    ],
	"click_through_details": [
		{
		"url": "http://www.facebook.com/my.organization",
		"url_uid": "1100397796080",
		"click_count": 83
		},
		{
		"url": "http://www.myorganizaton.net/mypage.html?utm_source=Email+Created+2013%2F01%2F15%2C+5%3A16+PM&utm_campaign=Campaign+Subject&utm_medium=email",
		"url_uid": "1100397796081",
		"click_count": 64
		},
		{
		"url": "http://www.linkedin.com/in/my.profile/",
		"url_uid": "1100397796079",
		"click_count": 24
		}
	]
}