segmentGet
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.
| Parameters |
| string token | A valid token for your account. To generate a token, use the login method. |
| string filter | Show emails where the segment name starts with the filter |
| integer pageNumber | Fetch results from the given page number. |
| integer pageSize | Number of results per page. |
| string orderBy | Sort the results based on "name" or "date". |
| Returns |
| array | Returns an array with the results. |
| Return Structure |
| integer sequence | The sequence number of the record |
| string id | The ID of the segment. To get the details of this segment, use the segmentGetDetail method. |
| integer contactCount | number of contacts in the segment |
| string segmentName | The name of the segment |
| integer listID | The ID of the contact list on which the segment is created |
| string listName | The name of the contact list on which the segment is created |
| string createdDate | The date on which the segment was created |
| string modifiedDate | The date on which the segment was last updated |
- <?php
- /**
- This Example shows how to authenticate a user using XML-RPC.
- Note that we are using the PEAR XML-RPC client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.php';
- $client = XML_RPC2_Client::create($apiURL);
- $token = $client->login($apiLogin, $apiPassword);
- $segmentLists = $client->segmentGet($token, "", 1, 100, "");
-
- foreach($segmentLists as $rec) {
- echo $rec['sequence'] . "] Segment Name: " . $rec['segmentName'] . "(" . $rec['id'] . ")";
- echo "\t To List:" . $rec['listname'] . "(" . $rec['listid'] . ")";
- echo "\t Created Date: " . $rec['createdDate'] ;
- echo "\t Updated Date: " . $rec['modifiedDate'];
- echo "<br />";
- }
-
- ?>