获取已删除收件人

Get removed subscribers 获取已删除收件人

Removed 接口允许检索因任何原因删除的收件人,任何删除类型,数据范围及列表的组合都可以用于搜索感兴趣的数据

请求数据格式

请求URL参数:
参数 类型 描述
apiKey string 你的API Key, 需要验证. 必填.
listIds int (CSV) 列表标识ID. 选填. 如指定, 只有曾经在指定列表中的已删除收件人会被返回. 如未指定, 从所有列表中删除的收件人都会被返回. 可以指定多个列表ID, 用逗号隔开, 如: 12,34,56,789
removeTypes string (CSV) 删除类型 (原因). 选填. 如指定, 只有指定原因的已删除收件人会被返回. 如忽略, 所有删除类型的数据都会被返回. 要指定多种删除类型, 用逗号分隔开, 如: OptOutLink,Ui. 所有删除类型见下表
startDate date 起始日期. 选填. 如指定, 在此日期之前删除的收件人不会被返回. 可以与 endDate 一同使用来定义一段时间区间.格式YYYY-MM-DD.
endDate date 见起始日期
option string 可选.如果指定该参数,会返回收件人的其他信息。
有效值:

    • Customs – 返回收件人所有属性和基本信息
channel string 限定返回值为指定通道. 选填. 默认为电子邮件. 有效值:

    • 全部
    • 电子邮件
    • 短信/彩信

注意:注意只有apiKey参数是必填的。但如果忽略其他参数,你会得到一个自创建业务单元伊始,由于任何原因,从所有列表中删除的所有收件人的集合

删除类型:

值名称 描述
OptOutLink 收件人点击过邮件中的退订链接.
Ui 通过用户界面手动移除 (ExpertSender后台).
BounceLimit 由于达到退信上限而被删除.
Complaint 收件人发起垃圾邮件投诉
UserUnknown 由于服务器返回邮件地址无效退信而删除 (Email 地址不存在).
Api 通过API删除.

示例URLs:

https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HEREhttps://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&listIds=1,3,16https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&startDate=2017-05-01&endDate=2017-09-01https://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&removeTypes=OptOutLink,Complaint,Uihttps://api.esv2.com/v2/Api/RemovedSubscribers?apiKey=YOUR_API_KEY_HERE&channel=EmailResponse

应答

应答Data元素:

元素/属性 类型 描述
RemovedSubscribers array[complex] RemovedSubscriber元素组成的数组.

RemovedSubscriber子元素:

元素/属性 类型 描述
Id int 收件人ID.
Email string 退订收件人的email.
Phone string 收件人电话号码.
ListId int 收件人从某列表退订,该列表的标识ID.
UnsubscribedOn dateTime 退订的日期时间.
如果”Customs”选项被指定的话,如下的信息也会被返回:
元素/属性 类型 描述
CustomSubscriberId string 收件人标识ID.
Firstname string 收件人的名.
Lastname string 收件人的姓.
Ip string 收件人的IP地址.
Vendor string 目前的发送方代码
Properties array[complex] 包含收件人属性的数组
Properties子元素:
元素/属性 类型 描述
Id integer 该属性ID
Source string 该属性值的来源
DateTimeValue datetime 属性值,仅”date”及”datetime”类型可用.
IntValue integer 属性值,仅”integer”类型可用.
StringValue string 属性值,仅”string”类型可用.
DecimalValue decimal 属性值,仅”money”类型可用.
Type string 属性类型. 请参考下文提供的所有可能的属性类型.
FriendlyName string 自定义属性名称.
Description string 该属性的描述.
Name string 该属性名称.
DefaultStringValue string 默认属性值,仅”string”类型可用.
DefaultIntValue integer 默认属性值,仅”integer”类型可用.
DefaultDateTimeValue datetime 默认属性值,仅”date”及”datetime”类型可用.
DefaultDecimalValue decimal 默认属性值,仅”money”类型可用.

Property来源:

名称 描述
Web 该属性通过收件人在线表单添加/修改.
Panel 该属性在ExpertSender系统中添加/修改.
Import 该属性通过导入的方式添加/修改.
Api 该属性通过API添加/修改.
PrefCenter 收件人在偏好中心自行添加/修改该属性.

Property类型:

名称 描述
Text 文本(字符串)属性.
Number 整数.例如”0″,”123″.
Money 保留两位小数的数字,如”10.99″.
Url 网址.
Date 日期,例如”2016-12-12″.
Datetime 日期和时间, 例如 ‘2011-01-01 12:00:00’.
SingleSelect 一个预定义的单选值,例如”选项1″
Boolean True/false.

示例

Simple 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
应答:
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>
  </RemovedSubscribers>
 </Data>
</ApiResponse>

Simple request with all channels全通道简易请求

3个收件人: 收件人1 邮件email test123@yahoo.com和电话号码 123456789, 收件人2 只有邮件email test456@gmail.com收件人3只有电话号码111222333. 这些收件人从列表1中移除全部发送通道.
请求:
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
应答:
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>
  </RemovedSubscribers>
 </Data>
</ApiResponse>

请求中带有”Customs”选项

请求:
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)
应答
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>