简体   繁体   中英

How can I get all the members of Given group Id of Given List Id from MailChimp API?

I am try to fetch the all list of members subscribe to given list for given Group from MailChip API.

I have two list in MailChimp.

1) Master List

   Groups: Group1, Group2

2) Test List

All user will be subscribe to each Group1, Group2 for List "Master List" Now I want to fetch all the members of "Master List" Who has subscribe for "Group1" ONLY.

So, Which API Method I can use to fetch all?

My Code:

$result = $mailChimp->listMembers( $listid, $status );

This will give me all the data from given list but I want to get specific Groups data any idea how can i get?

API Detail: listMembers – v1.3

listMembers(string apikey, string id, string status, string since, int start, int limit, string sort_dir)

Get all of the list members for a list that are of a particular status. Are you trying to get a dump including lots of merge data or specific members of a list?

this might solve your problem. If your API wrapper does not contain this function, add it as follows:

function searchMembers(string query, string id, int offset=0) {
    $params = array();
    $params["query"] = $query;
    $params["id"] = $id;
    $params["offset"] = $offset;
    return $this->callServer("searchMembers", $params);
}

Not sure this will solve your problem or not, but this will surly get you started...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM