We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

400 error trying to create new campaign

SOLVED
Go to solution
ErinM55
Occasional Participant

400 error trying to create new campaign

When trying to create a new email campaign--using a script which has been run successfully, daily, for months--I'm suddenly getting the response "Error 400: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>."

 

The xml I'm sending to the CC API is inline below. Would be grateful for any guidance on what's causing this.

 

</entry>

 

<?xml version='1.0' encoding='UTF-8'?>

<entry xmlns="http://www.w3.org/2005/Atom">

  <link href="/ws/customers/stuff@alphabeticall.com/campaigns" rel="edit" />

  <id>http://api.constantcontact.com/ws/customers/stuff@alphabeticall.com/campaigns</id>

  <title type="text">API Test Email</title>

  <updated>2011-06-13T03:22:02Z</updated>

  <author>

    <name>Wordnik.com</name>

  </author>

  <content type="application/vnd.ctct+xml">

    <Campaign xmlns="http://ws.constantcontact.com/ns/1.0/"

id="http://api.constantcontact.com/ws/customers/stuff@alphabeticall.com/campaigns/1100546096289">

      <Name>WOTD June 13, 2011: lorette</Name>

      <Status>Draft</Status>

      <Date>2009-10-19T18:34:53.105Z</Date>

      <Subject>June 13, 2011: lorette</Subject>

      <FromName>Wordnik WotD</FromName>

      <ViewAsWebpage>NO</ViewAsWebpage>

      <ViewAsWebpageLinkText></ViewAsWebpageLinkText>

      <ViewAsWebpageText></ViewAsWebpageText>

      <PermissionReminder>NO</PermissionReminder>

      <PermissionReminderText></PermissionReminderText>

      <GreetingSalutation></GreetingSalutation>

      <GreetingName>NONE</GreetingName>

      <GreetingString></GreetingString>

      <OrganizationName>Wordnik.com</OrganizationName>

      <OrganizationAddress1>PO Box 1771</OrganizationAddress1>

      <OrganizationAddress2></OrganizationAddress2>

      <OrganizationAddress3></OrganizationAddress3>

      <OrganizationCity>Burlingame</OrganizationCity>

      <OrganizationState>CA</OrganizationState>

      <OrganizationInternationalState></OrganizationInternationalState>

      <OrganizationCountry>us</OrganizationCountry>

      <OrganizationPostalCode>94011</OrganizationPostalCode>

      <IncludeForwardEmail>NO</IncludeForwardEmail>

      <ForwardEmailLinkText></ForwardEmailLinkText>

      <IncludeSubscribeLink>NO</IncludeSubscribeLink>

      <SubscribeLinkText></SubscribeLinkText>

      <EmailContentFormat>HTML</EmailContentFormat>

      <EmailContent>&lt;html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml

xmlns:cctd="http://www.constantcontact.com/cctd">

&lt;body>

&lt;OpenTracking/>

&lt;!--  Do NOT delete previous line if you want to get statistics on the number of opened emails -->

 

&lt;div>

&lt;p>The Wordnik Word of the Day for June 13, 2011 is&lt;/p>

 

&lt;h1 style="padding-bottom:0;margin-bottom:0;">lorette&lt;/h1>

&lt;h2 style="padding-top:0;margin-top:0;">&lt;a href="http://www.wordnik.com/words/lorette">http://www.wordnik.com/words/lorette&lt;/a>&lt;/h2>

 

&lt;p>(noun) In French usage, a member of the demi-monde. A lorette differs from a grisette - a young woman of the working class - only in living in a more showy style, and doing no work, being entirely supported by her admirers.&lt;/p>

 

&lt;p>'Lorette' derives its name from the church of Notre Dame de Lorette, in Paris, near which many of them resided.&lt;/p>

 

&lt;p>

&lt;div>Example:&lt;/div>

&lt;div>"The bal Mabile is not the polymnia dance of the Janiculum, but the dealer in ladies' wearing apparel there devours the lorette with her eyes, exactly as the procuress Staphyla lay in wait for the virgin Planesium."&lt;/div>

&lt;div>&nbsp; --&lt;a href="http://etext.lib.virginia.edu/etcbin/toccer-new2?id=Hug3Mis.sgm&images=images%2Fmodeng&data=%2Ftexts...">Les Miserables, Volume III, Marius&lt;/a>&lt;/div>

&lt;/p>

 

&lt;p style="padding-top:20px;">

&lt;div>View previous words of the day:&lt;/div>

&lt;div>&lt;a href="http://www.wordnik.com/word-of-the-day">http://www.wordnik.com/word-of-the-day&lt;/a>&lt;/div>

&lt;/p>

 

&lt;p>

&lt;div>Set which emails you receive from Wordnik:&lt;/div>

&lt;div>&lt;a href="http://www.wordnik.com/people/edit?s=prefs">http://www.wordnik.com/people/edit?s=prefs&lt;/a>&lt;/div>

&lt;/p>

 

&lt;div style="padding:10px 0">...&lt;/div>

 

&lt;p>

&lt;div>If you got this as a forward you too, by becoming a Wordnik, can be amused and delighted daily.&lt;/div>

&lt;div>&lt;a href="http://www.wordnik.com/signup">http://www.wordnik.com/signup&lt;/a>&lt;/div>

&lt;/p>

 

&lt;p>

&lt;div>You also might enjoy Wordnik's Google Gadgets&lt;/div>

&lt;div>http://www.google.com/ig/directory?q=wordnik&lt;/div>

&lt;/p>

 

&lt;/div>

 

 

&lt;/body>

&lt;/html></EmailContent>

      <EmailTextContent>&lt;Text>

      

      The Wordnik Word of the Day for June 13, 2011:

 

lorette

http://www.wordnik.com/words/lorette

 

(noun) In French usage, a member of the demi-monde. A lorette differs from a grisette - a young woman of the working class - only in living in a more showy style, and doing no work, being entirely supported by her admirers.

 

'Lorette' derives its name from the church of Notre Dame de Lorette, in Paris, near which many of them resided.

 

Example:

"The bal Mabile is not the polymnia dance of the Janiculum, but the dealer in ladies' wearing apparel there devours the lorette with her eyes, exactly as the procuress Staphyla lay in wait for the virgin Planesium."

 --Les Miserables, Volume III, Marius (http://etext.lib.virginia.edu/etcbin/toccer-new2?id=Hug3Mis.sgm&images=images%2Fmodeng&data=%2Ftexts...

 

 

View previous words of the day:

http://www.wordnik.com/word-of-the-day

 

Set which emails you receive from Wordnik:

http://www.wordnik.com/people/edit?s=prefs

 

 

...

 

 

If you got this as a forward you too, by becoming a Wordnik, can be amused and delighted daily.

http://www.wordnik.com/signup

 

You also might enjoy Wordnik's Google Gadgets

http://www.google.com/ig/directory?q=wordnik

 

 

      

      &lt;/Text></EmailTextContent>

      <StyleSheet></StyleSheet>

      <ContactLists>

        <ContactList id="http://api.constantcontact.com/ws/customers/stuff@alphabeticall.com/lists/2">

          <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/stuff@alphabeticall.com/lists/2" rel="self" />

        </ContactList>

      </ContactLists>

      <FromEmail>

        <Email id="http://api.constantcontact.com/ws/customers/stuff@alphabeticall.com/settings/emailaddresses/2">

          <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/stuff@alphabeticall.com/settings/emailaddresses/2"

          rel="self" />

        </Email>

        <EmailAddress>feedback@wordnik.com</EmailAddress>

      </FromEmail>

      <ReplyToEmail>

        <Email id="http://api.constantcontact.com/ws/customers/stuff@alphabeticall.com/settings/emailaddresses/2">

          <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/stuff@alphabeticall.com/settings/emailaddresses/2"

          rel="self" />

        </Email>

        <EmailAddress>feedback@wordnik.com</EmailAddress>

      </ReplyToEmail>

    </Campaign>

  </content>

  <source>

    <id>http://api.constantcontact.com/ws/customers/stuff@alphabeticall.com/campaigns</id>

    <title type="text">Campaigns for customer: Wordnik</title>

    <link href="campaigns" />

    <link href="campaigns" rel="self" />

    <author>

      <name>Wordnik.com</name>

    </author>

    <updated>2011-06-13T03:22:02Z</updated>

  </source>

1 ACCEPTED SOLUTION
ErinM55
Occasional Participant

Encoding those ampersands fixed it. I'm amazed we haven't been bitten by that before. Really appreciate your fast response--thanks much!

View solution in original post

4 REPLIES 4
Andrew_W
Employee

Hi Erin,

 

We are very sorry for any inconvenience this has caused you.  At this time, we have isolated this to be an issue with how our system is handling the @ symbol in your username.  If you change this, your XML post should be successful.

 

Our engineers are currently reviewing this defect and working towards a solution.

 

Thanks,

Andrew Weber
Associate Product Manager for EventSpot

Hi Erin,

 

Sorry for the miss information.  After further review we saw that removing the content in <EmailContent> tag and replacing with different information seemed to correct this issue.  Appears there is something in that node that our system does not like.  

 

We are still reviewing to pin point exactly what that might be.

Andrew Weber
Associate Product Manager for EventSpot

Hi Erin,

 

Sorry for the delay.

 

What we have found are "&" characters in your <EmailContent> and <EmailTextContent> nodes which have to be encoded for the XML parser to work properly.  

 

If you have any further questions, please let us know.

 

Thanks,

Andrew Weber
Associate Product Manager for EventSpot
ErinM55
Occasional Participant

Encoding those ampersands fixed it. I'm amazed we haven't been bitten by that before. Really appreciate your fast response--thanks much!

View solution in original post

Developer Portal

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

Visit Page