API getsubscriber not showing email

007

Member
Hello all,
When I send an API request using the getSubscriber function, I don't receive back the subscriber's email address, which is the data that I want. Is there a way to get the email address via API, using the subscriber's uid? I can get other data back, like FNAME and LNAME, so I know that the API is working.

Here's the code I'm using:
Code:
$response = $endpoint->getSubscriber($listUid, $subscriber_uid);

The response I get back is:
Code:
MailWizzApi_Params::__set_state(array(
   '_data' =>
  array (
    'status' => 'success',
    'data' =>
    array (
      'record' =>
      array (
        'subscriber_uid' => 'ab12345',
        'status' => 'confirmed',
        'source' => 'web',
        'ip_address' => '123.45.67.890',
        'FNAME' => 'asdf',
        'LNAME' => 'asdf',
        'COMPANY' => 'asdf',
      ),
    ),
  ),
   '_readOnly' => false,
))
 
@007 - I think i found why. Please open /apps/api/controllers/List_subscribersController.php
and at line 204 you have:
PHP:
if ($field->tag == 'EMAIL') {
    $record[$field->tag] = CHtml::encode($subscriber->displayEmail);
    continue;
}
Make it:
PHP:
if ($field->tag == 'EMAIL') {
    $data['record'][$field->tag] = CHtml::encode($subscriber->displayEmail);
    continue;
}
Save the file and try again, that should do it.
 
Back
Top