Back to Documentation OverviewlistMembers
public static listMembers(string uid, string id, string status, int start, int limit)
Get all of the list members of a list that are of a particular status
- Section:
- List Related
- Parameters:
| uid | the id for your user account. Get by calling login($user, $pass) |
| id | the list id to connect to |
| status | the status to get members for - one of(subscribed, unsubscribed, or cleaned), defaults to subscribed |
| start | optional - , for large data sets, the page number to start at - defaults to 1st page of data (page 0) |
| limit | optional - , for large data sets, the number of results to return - defaults to 100, upper limit set at 15000 |
- Returns:
- array - Array of list member structs (see Returned Fields for details)
- Returned Fields:
| string | email | Member email address |
| date | timestamp | timestamp of their associated status(date subscribed, unsubscribed, or cleaned) |
Examples (1)[1] mcapi_listMembers.php<?php /** This Example shows how to pull the Members of a List using the MCAPI.php class and do some basic error checking. **/ // Include the MailChimp API code. Do Not Edit This! include('inc/MCAPI.class.php'); include('inc/config.inc.php'); //contains username & password // Connect to the MailChimp server with the user's credentials. $acct = new MCAPI($mailChimpUser, $mailChimpPass); $retval = $acct->listMembers( $listId , 'subscribed', 0, 5000 ); if (!$retval){ echo "\n\tCode=".$acct->errorCode; echo "\n\tMsg=".$acct->errorMessage."\n"; } else { } ?>
|