API Documentation V2
Removed collection allows retrieving a list of subscribers removed from lists for any reason. Any combination of remove type, data range and list can be specified to help with searching for data of interest.
Request URL parameters:
Note: Make notice that only apiKey parameter is required. If you omit other parameters, you will get a list of all subscribers removed for any reason, from any list, since the creation of your business unit.
Remove types:
Example URLs:
https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE
https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&listIds=1,3,16
https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&startDate=2017-05-01&endDate=2017-09-01
https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&removeTypes=OptOutLink,Complaint,Ui
https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&channel=Email
Response Data element:
RemovedSubscriber element children:
Additional elements returned with "Customs" option specified:
Properties element children:
Property sources:
Property types:
Simple request
Request:
GET http://api.esv2.com/v2/Api/RemovedSubscribers?startDate=2011-02-01&apiKey=test_api_key1&listIds=1&endDate=2011-09-16 HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 17 May 2012 13:15:26 GMT
Content-Length: 535
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<RemovedSubscribers>
<RemovedSubscriber>
<Id>123</Id>
<Email>test123@yahoo.com</Email>
<ListId>1</ListId>
<UnsubscribedOn>2011-07-21T00:00:00Z</UnsubscribedOn>
</RemovedSubscriber>
<RemovedSubscriber>
<Id>456</Id>
<Email>test456@yahoo.com</Email>
<ListId>1</ListId>
<UnsubscribedOn>2011-09-14T11:37:20Z</UnsubscribedOn>
</RemovedSubscriber>
</Data>
</ApiResponse>
Simple request with all channels
We have three subscribers: Sub1 with email test123@yahoo.com and phone number 123456789, Sub2 with only email test456@gmail.com and Sub3 with only phone 111222333. All of them were removed from list 1 on all channels.
Request:
GET http://api.esv2.com/v2/Api/RemovedSubscribers?startDate=2017-02-01&apiKey=test_api_key1&listIds=1&endDate=2017-09-16&channel=All 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
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 17 May 2012 13:15:26 GMT
Content-Length: 535
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<RemovedSubscribers>
<RemovedSubscriber>
<Id>123</Id>
<Email>test123@yahoo.com</Email>
<ListId>1</ListId>
<UnsubscribedOn>2017-07-21T00:00:00Z</UnsubscribedOn>
</RemovedSubscriber>
<RemovedSubscriber>
<Id>123</Id>
<Phone>123456789</Phone>
<ListId>1</ListId>
<UnsubscribedOn>2017-07-21T00:00:00Z</UnsubscribedOn>
</RemovedSubscriber>
<RemovedSubscriber>
<Id>456</Id>
<Email>test456@yahoo.com</Email>
<ListId>1</ListId>
<UnsubscribedOn>2017-08-02T11:37:20Z</UnsubscribedOn>
</RemovedSubscriber>
<RemovedSubscriber>
<Id>456</Id>
<Phone>111222333</Phone>
<ListId>1</ListId>
<UnsubscribedOn>2017-09-15T04:10:00Z</UnsubscribedOn>
</RemovedSubscriber>
</Data>
</ApiResponse>
Request with "Customs" option
Request:
GET http://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=test_api_key1&startDate=2016-05-01&option=Customs HTTP/1.1
Accept-Encoding: gzip,deflate
Host: api.esv2.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Fri, 15 Jul 2016 10:36:47 GMT
Content-Length: 2866
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<RemovedSubscribers>
<RemovedSubscriber xsi:type="FullRemovedSubscriber">
<Id>123</Id>
<Email>test123@yahoo.com</Email>
<ListId>1194</ListId>
<UnsubscribedOn>2016-06-21T08:33:34Z</UnsubscribedOn>
<Properties>
<Property>
<Id>1</Id>
<Source>NotSet</Source>
<StringValue xsi:type="xsd:string">abc</StringValue>
<Type>Text</Type>
<FriendlyName>tekst</FriendlyName>
<Description>tekstowa cecha xxx</Description>
<Name>tekst</Name>
<DefaultStringValue xsi:type="xsd:string">abc</DefaultStringValue>
</Property>
<Property>
<Id>9</Id>
<Source>NotSet</Source>
<IntValue xsi:type="xsd:int">1</IntValue>
<Type>Boolean</Type>
<FriendlyName>testowy boolean "fifi"</FriendlyName>
<Description>to jest test</Description>
<Name>test_bool</Name>
<DefaultIntValue xsi:type="xsd:int">1</DefaultIntValue>
</Property>
<Property>
<Id>23</Id>
<Source>NotSet</Source>
<DecimalValue xsi:type="xsd:decimal">3.14</DecimalValue>
<Type>Money</Type>
<FriendlyName>kwota</FriendlyName>
<Description />
<Name>kwota</Name>
<DefaultDecimalValue xsi:type="xsd:decimal">3.14</DefaultDecimalValue>
</Property>
</Properties>
<Firstname />
<Lastname />
<Ip />
<Vendor />
</RemovedSubscriber>
</RemovedSubscribers>
</Data>
</ApiResponse>