listGetContactDetails
public static array listGetContactDetails(string token, string listID, string emailAddress)
Get the contact details from the contact list
| Parameters |
| string token | A valid token for your account. To generate a token, use the login method. |
| string listID | The contact list ID from which you want to retrieve records. To get the contact lists in your account, use the listGet method. |
| string emailAddress | The email address for which details are required |
| Returns |
| array | Returns an array with the contact details. |
| Return Structure |
| integer sequence | The sequence number of the record |
| string id | The ID of the contact |
| string email | Email Address of the contact |
| string Other Fields | All other fields based on the contact list fields are displayed. The name of the fields will correspond to the field names used when creating the contact list |
- <?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);
- /**
- Fetch the latest contact list, so we can retrieve the contact list ID.
- **/
- $contactList = $client->listGet($token, "", 1, 1, "", "");
- $listID = $contactList[0]['id'];
-
- /**
- Fetch the first contact records, so we can retrieve the email to fetch the details.
- **/
- $contact = $client->listGetContacts($token, $listID, "", 1, 1, "", "");
- $contactEmail = $contact[0]['email'];
-
- $contactDetail = $client->listGetContactDetails($token, $listID, $contactEmail);
- foreach($contactDetail as $key => $value) {
- echo $key . ": " . $value . "<br />";
- }
-
- ?>