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

Test Sending an Email Campaign

Use this endpoint to test what an email campaign message will look like by sending it to a maximum of 5 recipients.

NOTE: Any dynamic content included in the campaign will not be processed because test send does not merge data from a contact list when sending the test message.

Methods:

Click a method to view its documentation

POST

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/{campaignId}/tests

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)

Example JSON Request BodyTOP

{
  "personal_message": "This is a test send of the email campaign message.",
  "email_addresses": ["address1@example.com", "address2@example.com","address3@example.com"],
  "format": "HTML_AND_TEXT"
}

Response CodesTOP

code

description

200

Request was successful

400

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

401

Authentication failure

404

No campaign found for provided campaignId

406

Unsupported accept header value, must be application/json

415

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

500

Internal server error occurred

StructureTOP

property

type(max length)

description

Example ResponseTOP

{
    "format": "HTML_AND_TEXT",
    "personal_message": "This is a test send of the email campaign message.",
    "email_addresses": [
        "address1@example.com",
        "address2@example.com",
        "address3@example.com"
    ]
}