The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Error 400: Invalid Content.(Create Campaign)

Occasional Contributor

Error 400: Invalid Content.(Create Campaign)



Please help me with the XML code. While adding a campaign I am getting Error 400.


?xml version="1.0" encoding="UTF-8" ?
  <link href="/ws/customers/" rel="edit" />
  <title type="text">API Test Email</title>
- <author>
  <name>Constant Contact</name>
- <content type="application/vnd.ctct+xml">
  <Name>API Test Email</Name>
  <Subject>Enter email subject here</Subject>
  <ViewAsWebpageLinkText />
  <ViewAsWebpageText />
  <PermissionReminderText />
  <OrganizationAddress1>Secotr 8</OrganizationAddress1>
  <OrganizationAddress2 />
  <OrganizationAddress3 />
  <OrganizationState />
  <OrganizationInternationalState>Uttar Pradesh</OrganizationInternationalState>
  <ForwardEmailLinkText />
  <SubscribeLinkText />
  <StyleSheet />
- <ContactLists>
  <link xmlns="" href="/ws/customers/" rel="self" />
- <FromEmail>
  <link xmlns="" href="/ws/customers/" rel="self" />
- <ReplyToEmail>
  <link xmlns="" href="/ws/customers/" rel="self" />
- <source>
  <title type="text">Campaigns for customer:</title>
  <link href="campaigns" />
  <link href="campaigns" rel="self" />
- <author>



Thanks & Regards,
Archana Singh

[*Note from a CTCT Community Admin: I removed the beginning and ending brackets from the "?xml version="1.0" encoding="UTF-8"?" line in your post above because that line breaks the "Developer Support" tab in our CTCT "Labs JMML Q&A" Facebook app (apparently, the app is trying to render that line as is, which wouldn't be acceptable in the middle of a page).]

Re: Error 400: Invalid Content.(Create Campaign)

Hi Archana,


It looks like the problem is coming from your EmailContent and EmailTextContent fields. Because of the format of the XML, any HTML tags need to start off with &lt; instead of the actual < symbol. Also, the EmailContent needs to be in a valid HTML format, so be sure to add html and body tags. So, those two tags should look like this:



 Let me know if you have any other problems. Thanks!

Nick Galbraith
Support Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More