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.

AddContactTolist, RemoveContactFromList

Highlighted
Occasional Contributor

AddContactTolist, RemoveContactFromList

In a nutshell what i need is something like this

 

AddContactToList (list id, contact id)

RemoveContactFromList (list id, contact id)

 

Seems to me that to remove a contact from a specific list is very cumbersome and requires multiple API calls. Also if you are not extremely careful then you may remove somene from a list that you didn't intend.

 

Correct me if I am wrong, but to remove someone from a specific list you have to

 

1) retrieve the contact by email address

2) remove that specific list from the list array, which involves a loop through the list and building a new updated list

3) update that contact passing the new list

3 REPLIES 3
Highlighted
Honored Contributor

Re: AddContactTolist, RemoveContactFromList

Hello,

 

You are correct about this being the "correct" method to remove a contact from a list. There was a separate method that was not officially documented which could provide a shorter set of steps. However, I need to verify that this method is valid and supported, because I would not want to share and endpoint that might not work in the future. Hopefully I should have an update on that front early next week!

 

Sincerely,

Elijah G.
API Support Engineer
Highlighted
Occasional Contributor

Re: AddContactTolist, RemoveContactFromList

I certainly appreciate the reply. Let me know what you find out. Thanks!

Highlighted
Honored Contributor

Re: AddContactTolist, RemoveContactFromList

Hello,

 

It took me a bit longer to get some answers on this, but I verified that we do have an endpoint on the API that is currently undocumented, but I was able to confirm that it does work. You can remove a contact from a specific list with the following API call: 

DELETE: https://api.constantcontact.com/v2/contacts/CONTACTID/lists/LISTID

On success, this will return a 204 status code with no contents.

 

Hopefully this helps you out! If you have any questions, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer
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