public static array segmentGet(string token, string filter, integer pageNumber, integer pageSize, string orderBy)
Get the list of segments using the filter and paging limits, order by the name or date of the segment.
Contact List Related Methods

string tokenA valid token for your account. To generate a token, use the login method.
string filterShow emails where the segment name starts with the filter
integer pageNumberFetch results from the given page number.
integer pageSizeNumber of results per page.
string orderBySort the results based on "name" or "date".

arrayReturns an array with the results.

Return Structure
integer sequenceThe sequence number of the record
string idThe ID of the segment. To get the details of this segment, use the segmentGetDetail method.
integer contactCountnumber of contacts in the segment
string segmentnameThe name of the segment
integer listIDThe ID of the contact list on which the segment is created
string listNameThe name of the contact list on which the segment is created
string createdDateThe date on which the segment was created
string modifiedDateThe date on which the segment was last updated

download example code

  1. <?php
  2. /**
  3. This Example shows how to authenticate a user using XML-RPC.
  4. Note that we are using the PEAR XML-RPC client and recommend others do as well.
  5. **/
  6. require_once 'XML/RPC2/Client.php';
  7. require_once 'inc/config.php';
  8. $client = XML_RPC2_Client::create($apiURL);
  9. $token = $client->login($apiLogin, $apiPassword);
  10. $segmentLists = $client->segmentGet($token, "", 1, 100, "");
  12. foreach($segmentLists as $rec) {
  13.     echo $rec['sequence'] . "] Segment Name: " . $rec['segmentname'] . "(" . $rec['id'] . ")";
  14.     echo "\t To List:" . $rec['listname'] . "(" . $rec['listid'] . ")";
  15.     echo "\t Created Date: " . $rec['createdDate'] ;
  16.     echo "\t Updated Date: " . $rec['modifiedDate'];
  17.     echo "<br />";
  18. }
  20. ?>