Error 400: Invalid Content.(Create Campaign)


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).]

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