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:write

Create a new event using a properly formatted JSON request payload, as shown in the Example JSON Request Body.

DescriptionTOP

Privileges required: mylibrary:folder:create

Create a new MyLibrary folder by providing the name of the folder and the id of the parent folder if the new folder is to be a child folder (nested in another folder) in the JSON request body. See the example JSON request in the following sections.

DescriptionTOP

Privileges required: campaign:write

Create a new item for an event specified using the eventId path parameter. To create an item, include the following items in the JSON request body:

  • name - each item for an event must have a unique name, with mininum length of 1 character
  • price - if an item is available at no cost to registrants and guest, set = 0.00
  • default_quantity_total - starting quantity of this item available to registrants and guests
  • per_registrant_limit - maximum quantity available to each registrant or guest
  • show_quantity_available - use this setting to display, or not, the remaining quantity available on the registration page.

Optionally you can include a description of the item in the request body as well.

After you create an item, you can then add attributes to it, such as sizes, colors, just to name a few, using the Item Attribute Collection endpoint.

DescriptionTOP

Privileges required: campaign:write

Create a promotional code for an existing event (specified using eventId). Promotional codes can be:

  • a percentage discount off a fee or set of fees
  • a fixed discount amount off a fee
  • a special promotional fee available by entering the promo code

DescriptionTOP

Privileges required: campaign:write

Create a new fee for the event specified using the eventId path parameter. 

DescriptionTOP

Privileges required: campaign:write

Create a new attribute for an event item; specify the event and item using the eventId and itemId path parameters. To create an attribute, include the attribute name and quantity_total (minimum = 0) in the JSON request body. Each attribute for an item must have a unique name with a minimum length of 1 character.

DescriptionTOP

Privileges required: campaign:activate

Schedule an email campaign specified by the campaignId path parameter to run and be sent out. Define the date and time that the email campaign will be submitted to the send queue (in ISO 8601 format) using the scheduled_date property. You can create a schedule only for an email campaign in DRAFT or SENT status.

When scheduling a campaign, please provide a lead time of at least 20 minutes; otherwise, you may receive an invalid schedule error response.

NOTE: The account must be in good standing to be able to schedule and send an email campaign. 

Sending a Campaign "Now"

To send a campaign "now", only include {} in the JSON request payload. When using the Send Now function, the response body will show the time that the scheduling request was made, not the time the email campaign will be sent. Send Now puts the campaign into the queue for the next send window, which occur on a regular basis, generally every 5 minutes.

Resending a Campaign

You can resend an existing campaign that has a SENT status using this endpoint. The campaign will only be sent to contacts that have been added to the contact lists since the last time the campaign was sent (based on the last_run_date value)

DescriptionTOP

Privileges required: campaign:create

When creating a new email campaign, template_type is automatically set to CUSTOM; There are several campaign properties that are optional by default, but become REQUIRED once another property is used. See Structure table below for specific properties.

DescriptionTOP

Privileges required: campaign:send

Send the email campaign message specified by the campaignId path parameter to the email addresses (maximum of 5) in the email_address array in the JSON request payload. You can preview email campaign messages with a status of DRAFT, SENT, and SCHEDULED.

Things to know about previews

  • Any content that is customized for each recipient in an email campaign will not be processed when the campaign is previewed. This is because the preview function does not use the syndication process used to deliver production campaigns. Previews are sent to email addresses, as opposed to a list of contacts. 

  • Email campaigns can, including previews messages, to up to 50 non-verified email addresses, 5 at a time, in a 24 hour period. There is no limit on sending messages to verified email addresses.

  • You need to set the format property to define the content types that will be sent in the preview:
    • HTML - sends only the HTML version of the message (defined in email_content)
    • TEXT - sends only the text version of the message (defined in text_content)
    • HTML_AND_TEXT - sends two test messages, the HTML and the text versions of the message.

NOTE: You cannot preview XHTML formatted email campaign messages (email_content_format = XHTML).

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

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

Example JSON Request BodyTOP

{
    "name": "Test Campaign 1351175725",
    "subject": "Subject Test",
    "from_name": "My Organization",
    "from_email": "from-email@example.com",
    "reply_to_email": "replyto-email@example.com",
    "is_permission_reminder_enabled": true,
    "permission_reminder_text": "As a reminder, 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.",
    "is_view_as_webpage_enabled": true,
    "view_as_web_page_text": "View this message as a web page",
    "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-only content of the email message for mail clients that do not support HTML.",
    "email_content_format": "HTML",
    "style_sheet": "",
    "message_footer": {
        "organization_name": "My Organization",
        "address_line_1": "123 Maple Street",
        "address_line_2": "Suite 1",
        "address_line_3": "",
        "city": "Anytown",
        "state": "MA",
        "international_state": "",
        "postal_code": "01444",
        "country": "US",
        "include_forward_email": true,
        "forward_email_link_text": "Click here to forward this message",
        "include_subscribe_link": true,
        "subscribe_link_text": "Subscribe to Our Newsletter!"
    }
   }

Response CodesTOP

code

description

201

Email campaign was successfully created

400

Bad Request:Either JSON was malformed or there was a data validation error

401

Authentication failure

406

Unsupported accept header value, must be application/json

409

Email Campaign name already in use

415

Unsupported content-type in the header, use application/json

500

Internal server error occurred

StructureTOP

property

type(max length)

description

Example ResponseTOP

{
    "id": "1113591978764",
    "name": "Test Campaign 1351175725",
    "subject": "Subject Test",
    "status": "DRAFT",
    "from_name": "My Organization",
    "from_email": "email@example.com",
    "reply_to_email": "email@example.com",
    "template_type": "CUSTOM",
    "is_permission_reminder_enabled": true,
    "permission_reminder_text": "As a reminder, 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.",
    "is_view_as_webpage_enabled": true,
    "view_as_web_page_text": "View this message as a web page",
    "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-only content of the email message for mail clients that do not support HTML.",
    "email_content_format": "HTML",
    "style_sheet": "",
    "message_footer": {
        "city": "Anytown",
        "state": "MA",
        "country": "US",
        "organization_name": "My Organization",
        "address_line_1": "123 Maple Street",
        "address_line_2": "Suite 1",
        "address_line_3": "",
        "international_state": "",
        "postal_code": "01444",
        "include_forward_email": true,
        "forward_email_link_text": "Click here to forward this message",
        "include_subscribe_link": true,
        "subscribe_link_text": "Subscribe to Our Newsletter!"
    },
    "tracking_summary": {
        "sends": 0,
        "opens": 0,
        "clicks": 0,
        "forwards": 0,
        "unsubscribes": 0,
        "bounces": 0
    }
}