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.

400 Error on creating new Contact: XML Looks okay

Highlighted
Occasional Visitor

400 Error on creating new Contact: XML Looks okay

I'm getting a 400 error while trying to create a new contact.

 

Here's the response:

HTTP/1.1 400 Bad Request Connection: close Content-Length: 152 Content-Type: text/plain Date: Tue, 12 Apr 2011 20:06:17 GMT Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie" Pragma: no-cache Server: Apache Vary: Accept-Encoding,User-Agent X-Powered-By: Set-Cookie: BIGipServerProdAPI=189142026.6695.0000; path=/ Error 400: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>.

 

Here's the response_body:

Error 400: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>.

 

Here's the XML:

<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="text"> </title>
  <updated>2008-07-23T14:21:06.407Z</updated>
  <author></author>
  <id>data:,none</id>
  <summary type="text">Contact</summary>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
      <EmailAddress>colin.foley1@accella.net</EmailAddress>
      <OptInSource>ACTION_BY_CONTACT</OptInSource>
<First Name>Colin</First Name>
<Last Name>Foley</Last Name>
<ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/pflatau/lists/5" /></ContactLists>
    </Contact>
  </content>
</entry>
-- Colin Foley Accella LLC www.accella.net
1 REPLY 1
Highlighted
Employee

Re: 400 Error on creating new Contact: XML Looks okay

Hello Colin,

 

I would like to help you with the XML issues that you are having.  I took a look at your XML and I see that the nodes "First Name" and "Last Name" have spaces in them.  I changed them to FirstName and LastName and it did work on my end.

 

If you are still having an issue or have any other questions, please let me know.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact
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
Featured