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>email@example.com</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
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.