updating contact - Contact Already Exists

laurent
Regular Participant

updating contact - Contact Already Exists

I try to remove a contact from lists and add to another list, but I just get "Contact Already Exists".

Is something wrong with that code below:

<entry xmlns="http://www.w3.org/2005/Atom">

<id>https://api.constantcontact.com/ws/customers//contacts/101</id>

<title type="text">Contact: </title>

<updated>2010-09-15T14:57:13Z</updated>

<author></author>

<content type="application/vnd.ctct+xml">

<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="https://api.constantcontact.com/ws/customers//contacts/101">

<EmailAddress></EmailAddress>

<OptInSource>ACTION_BY_CONTACT</OptInSource>

<ContactLists>

<ContactList id="https://api.constantcontact.com/ws/customers//lists/10" />

</ContactLists>

</Contact>

</content>

</entry>

 

3 REPLIES 3
bsoder
Employee

Hello,



The XML that you have is the minimum you need to create a contact from scratch. In order to remove a list from a contact and add a new list, you need to do an update on the contact that already exists.



The way to do this is to do a GET call on the original contact, which gives you their XML. Then modify the XML so that the contact list node that they have changes from the one they are in to the new list. Then you would do a PUT call to the contact's URI (eg: https://api.constantcontact.com/ws/customers/username/contacts/12).  This will update their information to have them in a new list.



If you have any questions about this please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
laurent
Regular Participant

I did a put call to the contact's URI (eg: https://api.constantcontact.com/ws/customers/username/contacts/101) but I still get a Contact Already Exists

bsoder
Employee

Hello,



Doing a PUT command updates the contact, it should not tell you that it already exists. Is it possible that you can send your code to the webservices support team and we can take a look and see what is going on?



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page