cancel
Showing results for 
Search instead for 
Did you mean: 

AddContactTolist, RemoveContactFromList

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
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
Occasional Contributor

Re: AddContactTolist, RemoveContactFromList

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

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
Still need help?
You can post a new message in the Community or find us on Twitter Mon-Fri 8am - 8pm ET. We've got real people waiting to help you out. Click below to start a conversation!