The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

updating contact - Contact Already Exists

Highlighted
Occasional 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
Highlighted
Employee

updating a contact to put them in a new list

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
Highlighted
Occasional Participant

I did a put call to the

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

Highlighted
Employee

PUT command error

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

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured