Get subscriber information
Get varied description of single Subscriber. There are 5 options of getting information:
Request data format
* At least one of the following must be specified: Id, Email, Md5, Sha256, Phone or CustomSubscriberId. System will firstly look for Id, then Email, Md5, Sha256, Phone and CustomSubscriberId. If more than one is specified system will use the first element with any value and ignore the others.
** For compatibility reasons, you may use integers (1, 2, 3, 4) instead of string. But this method of selecting type of returned information should be considered deprecated.
Response
Response Data element:
StateOnList element children:
Response for "Long" information
Response Data element:
StateOnList element children:
SuppressionList element children:
Response for "Full" information
Response Data element:
StateOnList element children:
SuppressionList element children:
Properties element children:
Property sources:
Property types:
Response for "EventsHistory" information
Response Data element:
Event element children:
Response for "SubscriptionsHistory" information
Response Data element:
SubscriptionEvent element children:
Examples
Getting subscriber's information:
Request:
GET https://api.esv2.com/v2/Api/Subscribers?apiKey=test_api_key1&email=john%40yahoo.com&option=Full&geoDetails=true HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
OK response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=soo4fqb5y5cjbr3wimnyelb3; path=/; HttpOnly
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 25 Apr 2016 16:07:21 GMT
Content-Length: 421
<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Data>
<BlackListEmail>false</BlackListEmail>
<BlackListPhone>false</BlackListPhone>
<StateOnLists>
<StateOnList>
<Email>john@yahoo.com</Email>
<ListId>123</ListId>
<Name>Testowa Lista</Name>
<Status>Unsubscribed</Status>
<SubscribedOn>2014-12-29T15:30:09</SubscribedOn>
<UnsubscriptionDate>2015-12-29T15:30:09</UnsubscriptionDate>
</StateOnList>
<StateOnList>
<Email>john@yahoo.com</Email>
<ListId>456</ListId>
<Name>Testowa Seed Lista 1 (3)</Name>
<Status>Active</Status>
<SubscribedOn>2014-11-12T12:30:41</SubscribedOn>
</StateOnList>
<StateOnList>
<Phone>48789456123</Phone>
<ListId>789</ListId>
<Name>Testowa Lista 2</Name>
<Status>Active</Status>
<SubscribedOn>2015-01-11T11:00:02</SubscribedOn>
</StateOnList>
</StateOnLists>
<SuppressionLists>
<SuppressionList>
<Id>1</Id>
<Name>testowa lista suppression nr 1</Name>
<Type>Phone<
</SuppressionList>
<SuppressionList>
<Id>2</Id>
<Name>testowa lista suppression nr 2</Name>
</SuppressionList>
</SuppressionLists>
<Id>3045574</Id>
<Email>john@yahoo.com</Email>
<Phone>48789456123</Phone>
<CustomSubscriberId>522145698</CustomSubscriberId>
<Firstname>John</Firstname>
<Lastname>Doe</Lastname>
<Vendor>RIVER2</Vendor>
<Ip>90.2.214.146</Ip>
<Properties>
<Property>
<Id>1</Id>
<Source>NotSet</Source>
<DateTimeValue xsi:type="xsd:dateTime">2016-07-19T00:00:00</DateTimeValue>
<Type>Datetime</Type>
<FriendlyName>Date added</FriendlyName>
<Description/>
<Name>dateadded</Name>
</Property>
<Property>
<Id>5</Id>
<Source>NotSet</Source>
<StringValue xsi:type="xsd:string">Mr</StringValue>
<Type>Text</Type>
<FriendlyName>Title</FriendlyName>
<Description/>
<Name>title</Name>
</Property>
</Properties>
<City>city</City>
<Country>country</Country>
<State>state</State>
</Data>
</ApiResponse>
Getting subscriber's events history:
Request:
GET https://api.esv2.com/v2/Api/Subscribers?apiKey=test_api_key1&email=john%40yahoo.com&option=EventsHistory HTTP/1.1
Accept-Encoding: gzip,deflate
Host: api.esv2.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
OK response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
Set-Cookie: TEMP_DATA=2baf0f58-63a5-44bc-9673-988be8061978; path=/
X-Powered-By: ASP.NET
Date: Tue, 27 Jan 2017 13:37:40 GMT
Content-Length: 1259
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<Events>
<Event>
<StartDate>2015-01-25T10:00:00</StartDate>
<EndDate>2015-01-25T11:00:00</EndDate>
<Channel>Email</Email>
<MessageType>Newsletter</MessageType>
<EventType>Click</EventType>
<EventCount>1</EventCount>
<MessageId>120540</MessageId>
<MessageSubject>test of links</MessageSubject>
</Event>
<Event>
<StartDate>2015-01-25T10:00:00</StartDate>
<EndDate>2015-01-25T11:00:00</EndDate>
<Channel>SmsMms</Email>
<MessageType>Newsletter</MessageType>
<EventType>Send</EventType>
<EventCount>1</EventCount>
<MessageId>473821</MessageId>
<MessageSubject>test competition announcement</MessageSubject>
</Event>
<Event>
<StartDate>2015-01-25T08:00:00</StartDate>
<EndDate>2015-01-25T09:00:00</EndDate>
<Channel>Email</Email>
<MessageType>Newsletter</MessageType>
<EventType>Send</EventType>
<EventCount>1</EventCount>
<MessageId>120540</MessageId>
<MessageSubject>test of links</MessageSubject>
</Event>
</Events>
</Data>
</ApiResponse>
Getting subscriber's subscriptions history:
Request:
GET https://api.esv2.com/v2/Api/Subscribers?apiKey=test_api_key1&email=john%40yahoo.com&option=SubscriptionsHistory HTTP/1.1 Accept-Encoding: gzip,deflate
Host: api.esv2.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
OK response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
Set-Cookie: TEMP_DATA=2baf0f58-63a5-44bc-9673-988be8061978; path=/
X-Powered-By: ASP.NET
Date: Tue, 27 Jan 2017 13:37:40 GMT
Content-Length: 734
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<SubscriptionsHistory>
<SubscriptionEvent>
<StartDate>2018-06-27T20:00:00</StartDate>
<EndDate>2018-06-27T21:00:00</EndDate>
<Channel>Email</Channel>
<EventType>Unsubscribed</EventType>
<List>[1] Some default list</List>
<EventSource>Opt-out link</EventSource>
</SubscriptionEvent>
<SubscriptionEvent>
<StartDate>2015-01-03T12:00:00</StartDate>
<EndDate>2015-01-25T13:00:00</EndDate>
<Channel>Email</Channel>
<EventType>Subscribed</EventType>
<List>[5] Special campaign list</List>
<EventSource>Import</EventSource>
</SubscriptionsHistory>
</Data>
</ApiResponse>