Paul Preibisch
Paul Preibisch

Reputation: 4332

How do I search Mailchimp for all members with a specific command using their API

Some of my members share a specific tag I have assigned them - ie: tag123

What api command can I use to retrieve all members who have this tag assigned to them?

Upvotes: 1

Views: 788

Answers (2)

Juan Rangel
Juan Rangel

Reputation: 115

You can't use /search_members end point to do that. That endpoint only searches in email, FNAME and LNAME. You need to get all members in your list, and after that search in your php script or whatever.

Upvotes: 2

Josip Kolarić
Josip Kolarić

Reputation: 476

You can try using the search-members GET API call with the specific tag set in the query field. (More on https://developer.mailchimp.com/documentation/mailchimp/reference/search-members/#read-get_search_members)

e.g.

curl --request GET \
--url 'https://usX.api.mailchimp.com/3.0/search-members?query=tag123' \
--user 'anystring:apikey' \
--include

Upvotes: 0

Related Questions