Remove List Assignment in V3 API

SOLVED
Go to solution
ChrisC37
Marketing Legend
0 Votes

Greetings.  I'm having difficulties removing a specific contact from list assignments using API3.  Typically I would just omit the "list_memberships":  node in the JSON structure if I wanted to remove them from all lists but doing so has no effect on the list assignment in CC.   

 

What is the proper method for removing a contact from all lists using API 3.  After I'm finished I'd like the Contact status to be "Not Assigned to Any Lists"

 

Thank you.

 

Chris

1 ACCEPTED SOLUTION
Courtney_E
Moderator
0 Votes

Hello Chris ,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

To remove all list memberships from a contact using the V3 API, you would want to use PUT /contacts/{contact_id} with a blank list value.

 

PUT (update) a Contact

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

Below is an example of what that might look like. Notice that the "list_memberships" parameter is included, but left blank so that it will overwrite any existing list data:

 

Request URL:

PUT https://api.cc.email/v3/contacts/{contact_id

 

Request Body:

{

  "email_address": {

    "address": "test@example.com",

    "permission_to_send": "implicit"

  },

  "create_source": "Account",

  "update_source": "Account",

  "list_memberships": []

}

 

Please have a look and let us know if you have any other questions!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.

View solution in original post

1 REPLY 1
Courtney_E
Moderator
0 Votes

Hello Chris ,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

To remove all list memberships from a contact using the V3 API, you would want to use PUT /contacts/{contact_id} with a blank list value.

 

PUT (update) a Contact

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

Below is an example of what that might look like. Notice that the "list_memberships" parameter is included, but left blank so that it will overwrite any existing list data:

 

Request URL:

PUT https://api.cc.email/v3/contacts/{contact_id

 

Request Body:

{

  "email_address": {

    "address": "test@example.com",

    "permission_to_send": "implicit"

  },

  "create_source": "Account",

  "update_source": "Account",

  "list_memberships": []

}

 

Please have a look and let us know if you have any other questions!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up