listSegmentMembers()

List of all segment members is obtained.

listSegmentMembers(integer $id, string $status, integer $start, integer $limit) : array
Input parameters
  • id - segment ID
  • status - email status (unsubscribed, inactive, bounced, subscribed) (optional). Default value is subscribed.
  • start - page number starting from which selection will be made (optional). Default value is 0.
  • limit - number of results returned in one page (optional). Default value is 100. Maximum allowable value is 15000.

Information obtained

Array of members. Each member is represented as an array consisting of:

  • id - member ID
  • list - list ID
  • email - email address
  • timestamp - date of adding email to the list in timestamp format

Examples

mgapi_listSegmentMembers.php
listSegmentMembers($id, $status, $start, $limit);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load listSegmentMembers()!";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "Members returned: ". sizeof($retval). "\n";
    foreach ($retval as $segment) {
        echo "\t".$member['email']." - ".$member['timestamp']."\n";
    }
}

© 2010-2017 Mailigen. All rights reserved.