Dave Fish
Dave Fish

Reputation: 43

Mailchimp API: How to get members in a list who have selected a particular interest

I am new to the Mailchimp API. I want to get a list of members from a list who have selected an interest (checkbox type) in an interest category. I don't know how to form the query statement for the members or search-members API method.

I did a web search for a Mailchimp API query example but couldn't find one pertaining to Groups.

I'm using Postman for now as part of my research. Here is an example of what I've tried (c133bd0ba3 is the ID of the Interest I want to check):

https://usX.api.mailchimp.com/3.0/search-members?query=c133bd0ba3=true,list_id=nnnxyz

I want the query to return a list of members who have selected the interest (value = true).

Any help is greatly appreciated.

Update: I found a way to get the information with the members API method call:

https://usX.api.mailchimp.com/3.0/lists/24b8bd6114/members?interest_category_id=2dd67a99be&interest_ids=8114c6945b&interest_match=all&fields=members.id,members.email_address

Curious if anyone knows how to create a query for the search-members API method to get this same result?

Upvotes: 1

Views: 1056

Answers (1)

Peter van Mourik
Peter van Mourik

Reputation: 223

The search-members API endpoint only functions the way it does in app where you can only search specific strings like names, email addresses, but not ids as those aren't visible in app.

However using the query string ?interest_ids=X attached to the end of GET lists/list_id/members will pull up anyone with that specific Interest ID. But that is what you allready figured out!

Upvotes: 0

Related Questions