listMemberInfo(string apikey, string id, string email_address)
Get all the information for a particular member of a list
| Section | List Related |
|---|
| Parameters | |
|---|---|
| apikey | a valid API Key for your user account. Get by visiting your API dashboard |
| id | the list id to connect to. Get by calling lists() |
| email_address | the member email address to get information for OR the "id" for the member returned from listMemberInfo, Webhooks, and Campaigns |
| Returns | |
|---|---|
| array | array of list member info (see Returned Fields for details) |
| Returned Fields | string | id | The unique id for this email address on an account | string | The email address associated with this record | string | email_type | The type of emails this customer asked to get: html, text, or mobile | array | merges | An associative array of all the merge tags and the data for those tags for this email address. Note: Interest Groups are returned as comma delimited strings - if a group name contains a comma, it will be escaped with a backslash. ie, "," => "\,". Groupings will be returned with their "id" and "name" as well as a "groups" field formatted just like Interest Groups | string | status | The subscription status for this email address, either subscribed, unsubscribed or cleaned | string | ip_opt | IP Address this address opted in from. | string | ip_signup | IP Address this address signed up from. | int | member_rating | the rating of the subscriber. This will be 1 - 5 as described here | string | campaign_id | If the user is unsubscribed and they unsubscribed from a specific campaign, that campaign_id will be listed, otherwise this is not returned. | array | lists | An associative array of the other lists this member belongs to - the key is the list id and the value is their status in that list. | date | timestamp | The time this email address was added to the list | date | info_changed | The last time this record was changed. If the record is old enough, this may be blank. | integer | web_id | The Member id used in our web app, allows you to create a link directly to it |
|---|
[1] mcapi_listMemberInfo.php
<?php /** This Example shows how to pull the Info for a Member of a List using the MCAPI.php class and do some basic error checking. **/ require_once 'inc/MCAPI.class.php'; require_once 'inc/config.inc.php'; //contains apikey $retval = $api->listMemberInfo( $listId, $my_email ); if ($api->errorCode){ } else { //below is stupid code specific to what is returned //Don't actually do something like this. foreach($retval as $k=>$v){ //handle the merges foreach($v as $l=>$w){ } } else { } } } ?>
[2] xml-rpc_listMemberInfo.php
<?php /** This Example shows how to retrieve a list subscriber's information 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.inc.php'; try { $result = $client->listMemberInfo($apikey, $listId, $my_email); foreach($result['merges'] as $k=>$v){ } } catch (XML_RPC2_FaultException $e){ } ?>