I'm trying to remove one contact from one list via the Bulk Activity API.
I get this error:
400 Bad Request: [[{“error_key”:“contacts.api.bad_request”,“error_message”:“source[list_ids] is empty, list_ids, contact_ids are mutually exclusive”}]]
My JSON payload only sends the one contact id that I want to remove from the list: (note that the quotes around the attribute names and values don't show up--they aren't there in the objects but apparently get added by the Spring Rest Tempate--I've had success calling other CC V3 API endpoints with this Java client).
{
source: {
contact_ids: [e19f3996-6e48-11ec-ac92-fa163e963dae]
},
list_ids: [24337c6e-6da8-11ec-b55c-fa163e470cab]
}
Solved! Go to Solution.
Hello SegmintD,
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.
In our logs, the specified request is registering like this (example below). The "list_ids":null in the request indicates that the parameter to remove contacts from a specific list has been left in the request with a value of null. Additionally, the source object in the request payload can contain only one of three mutually exclusive properties identifying the contacts to remove from lists, and this request includes all three.
{"source":{"list_ids":null,"all_active_contacts":false,"contact_ids":["e19f3996-6e48-11ec-ac92-fa163e963dae"]},"list_ids":["24337c6e-6da8-11ec-b55c-fa163e470cab"]}
Documentation to Remove Contacts from Lists Bulk Activity
https://v3.developer.constantcontact.com/api_guide/remove_list_membership.html
If you are just looking to remove one contact from one list, you’d want to format your request body like this:
{ "source" : { "contact_ids" : [ "e19f3996-6e48-11ec-ac92-fa163e963dae" ] }, "list_ids" : [ "24337c6e-6da8-11ec-b55c-fa163e470cab" ] }
Please have a look and let us know if you have any other questions! If you continue to get error responses, feel free to contact us directly at webservices@constantcontact.com with your full request URL and body and we’d be happy to troubleshoot with you further.
Hello SegmintD,
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.
In our logs, the specified request is registering like this (example below). The "list_ids":null in the request indicates that the parameter to remove contacts from a specific list has been left in the request with a value of null. Additionally, the source object in the request payload can contain only one of three mutually exclusive properties identifying the contacts to remove from lists, and this request includes all three.
{"source":{"list_ids":null,"all_active_contacts":false,"contact_ids":["e19f3996-6e48-11ec-ac92-fa163e963dae"]},"list_ids":["24337c6e-6da8-11ec-b55c-fa163e470cab"]}
Documentation to Remove Contacts from Lists Bulk Activity
https://v3.developer.constantcontact.com/api_guide/remove_list_membership.html
If you are just looking to remove one contact from one list, you’d want to format your request body like this:
{ "source" : { "contact_ids" : [ "e19f3996-6e48-11ec-ac92-fa163e963dae" ] }, "list_ids" : [ "24337c6e-6da8-11ec-b55c-fa163e470cab" ] }
Please have a look and let us know if you have any other questions! If you continue to get error responses, feel free to contact us directly at webservices@constantcontact.com with your full request URL and body and we’d be happy to troubleshoot with you further.
Thanks for the followup. I looked closely at my Client API code (which was generated Java code done using the CC V3 schema and swagger) and it was sending all 3 of mutually exclusive attributes in the source. I had to change some properties to not be used when null and it is working now.
Regards,
Robert at Segmint, Inc
Announcements
Join our list to be notified of new features and updates to our V3 API.
Sign Up