Getting a subscriber by email (apiGetSubscriberByEmail)
With this option, you retrieve the id and several other information of a certain subscriber by email. This function takes the email as a parameter.
Request
Name | Type | Example | Required | Comment |
---|---|---|---|---|
String | user@domain.com |
Response
stdClass Object ( [subsriberResponse] => stdClass Object ( [subscriberID] => 1234567 [customFields] => Array ( [0] => stdClass Object ( [customFieldID] => 1 [customFieldValue] => Mr ) [1] => stdClass Object ( [customFieldID] => 2 [customFieldValue] => John ) [2] => stdClass Object ( [customFieldID] => 3 [customFieldValue] => Yes ) [3] => stdClass Object ( [customFieldID] => 4 [customFieldValue] => 31 ) ) [subsriberHistory] => Array ( [0] => stdClass Object ( [newsletterID] => 1234 [newsletterName] => Newsletter #1 ) [1] => stdClass Object ( [newsletterID] => 1235 [newsletterName] => Newsletter #2 ) ) ) )
Error Response
Code | Interpretation |
---|---|
404 | No valid email given. |
204 | No subscriber found. |
PHP5 Example
try{ $request = array( 'email'=> 'user@domain.com' ); $response=$client->apiGetSubscriberByEmail($request); } catch (SoapFault $exception) { echo ($exception->getMessage()); }