- Constant Contact Community
- :
- Developer Community
- :
- Authentication and Access (ie. 401 errors!)
- :
- Re: Error 415 when updating contact lists
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Error 415 when updating contact lists
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-22-2011 02:32 PM
I'm trying to update a contact and I believe I'm doing everything right. However, I receive the following error:
Error 415: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>.
I'm trying to add the contact to another contact list and I'm using PUT with a modified version of the data I receive from a GET on that contact. Here's the XML that I'm trying to PUT
<?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <link href="/ws/customers/TrellistNick/contacts/1" rel="edit"></link> <id>http://api.constantcontact.com/ws/customers/TrellistNick/contacts/1</id> <title type="text">Contact: ncohen@trellist.com</title> <updated>2011-08-18T21:00:53.503Z</updated> <author> <name>Constant Contact</name> </author> <content type="application/vnd.ctct+xml"> <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/Trelli stNick/contacts/1"> <Status>Active</Status> <EmailAddress>ncohen@trellist.com</EmailAddress> <EmailType>HTML</EmailType> <Name>Nick Cohen</Name> <FirstName>Nick</FirstName> <MiddleName></MiddleName> <LastName>Cohen</LastName> <JobTitle></JobTitle> <CompanyName></CompanyName> <HomePhone></HomePhone> <WorkPhone></WorkPhone> <Addr1></Addr1> <Addr2></Addr2> <Addr3></Addr3> <City></City> <StateCode></StateCode> <StateName></StateName> <CountryCode></CountryCode> <CountryName></CountryName> <PostalCode></PostalCode> <SubPostalCode></SubPostalCode> <Note></Note> <CustomField1></CustomField1> <CustomField2></CustomField2> <CustomField3></CustomField3> <CustomField4></CustomField4> <CustomField5></CustomField5> <CustomField6></CustomField6> <CustomField7></CustomField7> <CustomField8></CustomField8> <CustomField9></CustomField9> <CustomField10></CustomField10> <CustomField11></CustomField11> <CustomField12></CustomField12> <CustomField13></CustomField13> <CustomField14></CustomField14> <CustomField15></CustomField15> <ContactLists> <ContactList id="http://api.constantcontact.com/ws/customers/Trelli stNick/lists/1"> <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/TrellistNick/lists/1" rel="self"></link> <OptInSource>ACTION_BY_CUSTOMER</OptInSource> <OptInTime>2011-08-16T18:50:52.361Z</OptInTime> </ContactList> <ContactList id="http://api.constantcontact.com/ws/customers/Trelli stNick/lists/3"> <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/TrellistNick/lists/3" rel="self"></link> <OptInSource>ACTION_BY_CUSTOMER</OptInSource> <OptInTime>2011-08-18T21:00:53.519Z</OptInTime> </ContactList> <ContactList id="http://api.constantcontact.com/ws/customers/Trelli stNick/lists/2"> <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/TrellistNick/lists/2" rel="self"></link> <OptInSource>ACTION_BY_CUSTOMER</OptInSource> <OptInTime>2011-08-16T18:50:52.361Z</OptInTime> </ContactList> </ContactLists> <Confirmed>true</Confirmed> <InsertTime>2011-08-16T18:50:52.358Z</InsertTime> <LastUpdateTime>2011-08-18T21:00:53.503Z</LastUpda teTime> </Contact> </content> <source> <id>http://api.constantcontact.com/ws/customers/Trelli stNick/contacts</id> <title type="text">Contacts for Customer: TrellistNick</title> <link href="contacts"></link> <link href="contacts" rel="self"></link> <author> <name>TrellistNick</name> </author> <updated>2011-08-22T18:30:28.797Z</updated> </source> </entry>
All I've done to the information that I receive is add the third <ContactList></ContactList> membership. Any help would be much appreciated.
Solved! Go to Solution.
Re: Error 415 when updating contact lists
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-22-2011 02:56 PM
Hi Nick,
It sounds like your headers may not be being set. When you do a PUT to your Contact you need to specify that you are setting your Content-Type to application/atom+xml.
Please let me know if this works for you.
Support Engineer, Constant Contact
Re: Error 415 when updating contact lists
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-22-2011 04:04 PM
Thanks for the tip Ryan...that worked. I re-used too much of my code from my GET function and forgot that the content-type header needed to be set for the PUT request.
Thanks again,
-Nick
Re: Error 415 when updating contact lists
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-26-2012 03:28 AM
Hi Ryan ,
Me also got the same error like "Error 415: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>."
my code is
| entry |
|
PLease let me know solution
thanks
Re: Error 415 when updating contact lists
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-26-2012 08:05 AM
Hi,
I'm not sure what program you're using to build your XML here, but could you post the XML that this produces?
Best Regards,
Shannon W.
API Support Specialist


