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

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.

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

+ click_through_details

array

Tracking summary data for this email campaign.

created_date

string

Date the email campaign was last sent to contacts, in ISO-8601 format

email_content

string (930000)

The full HTML or XHTML content of the email campaign. This field is not available (and read-only) when accessed using the API if the template_type = STOCK and TEMPLATE_V2

email_content_format

string

Specifies the email campaign message format, valid values: HTML, XHTML; if not specified, defaults to HTML. If XHTML, the text_content text needs to be wrapped with <text></text>

from_email

string (80)

The email address the email campaign originated from, this must be a verified email address associated with the account.

from_name

string (100)

Name displayed in the From field to indicate whom the email is from

greeting_name

string

This is the personalized content for each contact that will be used in the greeting, valid values are:

  • FIRST_NAME - contacts first name on record
  • LAST_NAME - contacts last name of record
  • FIRST_AND_LAST_NAME - use both the contacts first and last name
  • NONE; if NONE then the email message will use the greeting_string parameter.

greeting_salutations

string (50)

The salutation used in the email message(e.g. Dear)

greeting_string

string (1500)

Specifies the greeting text used if not using greeting_name and greeting_salutations, which have precedence over greeting_string)

id

string

Unique identifier for the email campaign

is_permission_reminder_enabled

boolean

If true, displays permission_reminder_text at top of email message reminding the recipient they are receiving the email because they have subscribed to an email list.

is_view_as_webpage_enabled

boolean

If true, displays the text and link specified in permission_reminder_text to view web page version of email message

last_run_date

string

Date the email campaign was last run, in ISO-8601 format. A scheduled campaign is run when it is in the process of being sent

+ message_footer

object

REQUIRED if the organization address is not set in the user's account. Defines the content of the email campaign message footer

modified_date

string

Date the email campaign was last modified, in ISO-8601 format

name

string (80)

Name of the email campaign; each email campaign name must be unique within a user's account

next_run_date

string

Date the email campaign is next scheduled to run and be sent to contacts, in ISO-8601 format

permalink_url

string

System generated, non-expiring link to use for sharing a sent email campaign using social channels. Only available for email campaigns with status of SENT. If the user removes the email campaign from their campaign list, the link is taken down. Any shared links will return a 404.

permission_reminder_text

string (1500)

REQUIRED if is_permission_reminder_enabled = true; enter text to display in the permission reminder message; otherwise not required

reply_to_email

string (80)

The reply-to email address for the email campaign, this must be a verified email address associated with the account.

+ sent_to_contact_lists

array

Unique IDs of the contact lists the email campaign message is sent to

status

string

Current status of the email campaign, valid values:

  • DRAFT: This is the default status for an email that is still being worked on. Draft emails have been saved and can be edited at any time.
  • RUNNING: The email messagSente is in the process of being sent and cannot be edited.
  • SENT: An email that has been sent has already been mailed to it's contact list. It cannot be edited.
  • SCHEDULED: A scheduled email has been set to mail on a specific date and cannot be edited unless it's returned to Draft status.

style_sheet

string

Valid only if email_content_format = XHTML; see the Advanced Editor Users Guide for specific formatting constraints. Lists the stylesheet elements used to format the email campaign message

subject

string (200)

The Subject Line for the email campaign

template_type

string

The template used to create the email campaign; valid values are STOCK, CUSTOM, and TEMPLATE_V2. For campaigns using the STOCK and TEMPLATE_V2 templates, the text_content and email_content fields are not available (and read-only) when the email campaign message is accessed using the API. Learn more here.

text_content

string (930000)

The content for the text-only version of the email campaign which is viewed by recipients whose email client does not accept HTML email. If email_content_format=XHTML, the text_content needs to be wrapped with <text></text>. This field is not available (and read-only) when accessed using the API if the template_type = STOCK and TEMPLATE_V2

+ tracking_summary

object

Campaign Tracking summary data for this email campaign.

view_as_web_page_link_text

string (50)

REQUIRED if is_view_as_webpage_enabled = true; enter desired link text to display in the View As Web page link; otherwise not required

view_as_web_page_text

string (50)

REQUIRED if is_view_as_webpage_enabled = true; enter text to display with link at the top of email message, such as "View this message as a web page"; otherwise not required

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
		}
	]
}