<?php
// client can de downloaded from https://github.com/Newsman/newsman-api-php
require_once("Newsman/Client.php");
// you can get your API KEY, your newsman_user_id and list_id from My account -> API
$newsman_user_id = "your-username";
$api_key = "your-api-key";
$segment_id = "15001"; // The ID of the segment
$start_page = "0"; // Optional for large lists. The page number to start. Defaults to first page (page = 0).
$limit = "50"; // Optional for large lists. The number of results to return per page. Defaults to 100. Upper limit is 1000.
try {
$client = new Newsman_Client($newsman_user_id, $api_key);
$ret = $client->segment->getSubscribers($segment_id, $start, $limit);
} catch (Exception $e) {
//do something with the error, eg: log $e->getMessage()
}
return $ret;
?>