listUpdateContactDetails
public static array listUpdateContactDetails(string token, string listID, string contactID, array contactDetail)
Update the given contact in the list based on the details provided.
Section
Contact List Related Methods

Parameters
string tokenA valid token for your account. To generate a token, use the login method.
string listIDThe contact list ID from which you want to retrieve records. To get the contact lists in your account, use the listGet method.
string contactIDThe contact ID which you want to update. To get the contact ID from a list in your account, use the listGetContacts method.
array contactDetailThe array containing the details for the contact. To refer to the existing structure in the list, use the listGetContactDetails method.

Returns
arrayReturns an array with the contact details.


Examples
download example code
xmlrpc_listUpdateContactDetails.php


  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. /**
  11. Fetch the latest contact list, so we can retrieve the contact list ID.
  12. **/
  13. $contactList = $client->listGet($token, "", 1, 1, "", "");
  14. $listID = $contactList[0]['id'];
  15.  
  16. /**
  17. Fetch the first contact records, so we can retrieve the Email to fetch the details.
  18. **/
  19. $contact = $client->listGetContacts($token, $listID, "", 1, 1, "", "");
  20. $contactEmail = $contact[0]['email'];
  21.  
  22. $contactDetail = $client->listGetContactDetails($token, $listID, $contactEmail);
  23. $contactID = $contactDetail['id'];
  24. $contactDetail['Company Name'] = "ACME";
  25. $contactDetail['FirstName'] = "Clark";
  26. $contactDetail['LastName'] = "Kent";
  27.  
  28. $updatedDetail = $client->listUpdateContactDetails($token, $listID, $contactID, $contactDetail);
  29. foreach($updatedDetail as $key => $value) {
  30.     echo $key . ": " . $value . "<br />";
  31. }
  32.  
  33. ?>