Join the Ready, Set, Send Challenge Week 3. Share your QR code or landing page and win a badge!

Remove Contacts from Lists Bulk Activity api error

SOLVED
Go to solution
SegmintD
Brand Influencer
0 Votes

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]
}

 

1 ACCEPTED SOLUTION
Courtney_E
Moderator
0 Votes

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.


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

2 REPLIES 2
Courtney_E
Moderator
0 Votes

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.


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.
SegmintD
Brand Influencer
0 Votes

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

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