Receiving XML related API Error

SOLVED
Go to solution
JennaS59
Participant

Receiving XML related API Error

Hi I'm working on putting together an integration and am receiving the following error:

 

Error 400: The request contains errors in the common Atom sections, which lie outside or , such as , , or .

 

After searching through your forums I've found that it's likely to be an error in my XML, here's the XML I'm posting to the API:

 

?xml version="1.0"?
<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"></title>
<updated>2012-03-11T14:19:37+00:00</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>test@ttest2.com</EmailAddress>
<FirstName>dfgsdfg</FirstName>
<LastName>sdfgsfg</LastName>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<CustomField1>March</CustomField1>
<CustomField2>2012-03-21</CustomField2>
<CustomField3>344 W State St</CustomField3>
<ContactLists>
<ContactList id="https://api.constantcontact.com/ws/customers/xxxx/lists/xx"/>
</ContactLists>
</Contact>
</content>
</entry>

 

I'm wondering what's wrong with the XML but am having trouble debugging the problem.

 

I can also provide a snippet of the code that builds and posts to the API if necessary,

 

Thanks!

 

[*Note from a CTCT Community Admin: I removed the beginning and ending brackets from the "?xml version="1.0"?" 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).]

1 ACCEPTED SOLUTION
Nick_G
Moderator

Hey Jenna,

 

This is actually a pretty small thing, took me a few minutes to find. Your id field contains a space. Removing that extra space lets the POST go through successfully.

 

<id>data:,none</id>

 

Nick Galbraith
Support Engineer

View solution in original post

2 REPLIES 2
Nick_G
Moderator

Hey Jenna,

 

This is actually a pretty small thing, took me a few minutes to find. Your id field contains a space. Removing that extra space lets the POST go through successfully.

 

<id>data:,none</id>

 

Nick Galbraith
Support Engineer

View solution in original post

JoyK8
Occasional Participant

Worked perfect!  Thanks Nick!

Developer Portal

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

Visit Page