listMemberInfo()

By sending a request that contains list ID and email address, you can obtain full information about the email of a specific recipient.

listMemberInfo(string $id, string $email_address) : array
Input parameters
  • id - list ID
  • email_address - email address or email ID

Information obtained

Information about email (array):

  • id - email ID
  • email - email address
  • email_type - email type (HTML, plain text)
  • merges - merge fields with appropriate values assigned to given recipient. Array consisting of key-value pairs where array key is a merge tag and key value represents assigned merge tag value for given recipient.
  • status - email status (inactive, subscribed, unsubscribed, bounced)
  • ip_opt - IP address of sign-up approval
  • ip_signup - IP address of sign-up initialization
  • timestamp - time of email added to list in timestamp format

Examples

mgapi_listMemberInfo.php
listMemberInfo($id, $email_address);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load listMemberInfo()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    foreach ($retval as $k => $v) {
        if (is_array($v)) {
            //handle the merges
            foreach ($v as $l => $w) {
                echo "\t$l = $w\n";
            }
        } else {
            echo "$k = $v\n";
        }
    }
}
xml-rpc_listMemberInfo.php
 new xmlrpcval($apikey),
                    'id' => new xmlrpcval($listId),
                    'email_address' => new xmlrpcval($my_email)
                ),
                'struct');
$f = new xmlrpcmsg('listMemberInfo', array($v));
$c = new xmlrpc_client($apiUrl["path"], $apiUrl['host'], 80);
$c->setDebug($debug);
$r = &$c->send($f);
 
header("Content-Type: text/plain");
if (!$r->faultCode()) {
    $retval = php_xmlrpc_decode($r->value());
    foreach ($retval as $k => $v) {
        if (is_array($v)) {
            //handle the merges
            foreach ($v as $l => $w) {
                echo "\t$l = $w\n";
            }
        } else {
            echo "$k = $v\n";
        }
    }
} else {
    echo "Unable to run listMemberInfo()!\n";
    echo "\tCode=" . $r->faultCode() . "\n";
    echo "\tMsg=" . $r->faultString() . "\n";
}
mgapi_listMemberInfo.py
from lib.config import * #contains apikey
from lib.MGAPI import MGAPI
 
# This Example shows how to ping using the MGAPI.php class and do some basic error checking.
 
api = MGAPI(apikey)
 
id = listId
email_address = my_email
 
retval = api.listMemberInfo(id, email_address)
if api.errorCode:
    print "Unable to load listMemberInfo()!"
    print "\tCode=", api.errorCode
    print "\tMsg=", api.errorMessage
else:
    for k,v in retval.items():
        if isinstance(v, dict):
            #handle the merges
            for l,w in v.items():
                print "\t", l, " = ", w
        elif isinstance(v, list):
            #handle the merges
            for l,w in enumerate(v):
                print "\t", l, " = ", w
        else:
            print k, " = ", v

© 2010-2017 Mailigen. All rights reserved.