I am attempting to add single contacts to a contactlist. I am using C# and have seen the sample code that was left. However, I have a few outstanding questions:
1. Confused about what contenttype to use.
2. What is the format for (contact) data string I need to compose?
Any help here would be greatly appreciated.
Answers
1. Use application/atom+xml as content type to send the data
2. Here is an example to format contact to send
<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>test101@example.com</EmailAddress> <FirstName>First</FirstName> <LastName>Last</LastName> <OptInSource>ACTION_BY_CONTACT</OptInSource> <ContactLists> <ContactList id="http://api.constantcontact.com/ws/customers/joesflowers/lists/1" /> </ContactLists> </Contact> </content> </entry>here is the link for more info http://developer.constantcontact.com/doc/contactsCollection
scroll down a little to look at Creating a new Contact section.
Adding contact issue
I am getting a 400 error returned. Is there something that anyone sees Im doing wrong? Thanks! FYI (C#)
My xml is not showing up with its data.appends below.....
Adding Contact - Need XML
I can't see what XML you are starting with (to append to). If you cannot post the XML which you are submitting, can you send it to our webservices support team?