注册送短信

API: AddressBook/Mail/Unsubscribe - 邮件退订


概览


addressbook/mail/unsubscribe 是 SUBMAIL 的邮件退订 API ,使用 addressbook/mail/unsubscribe API 管理你的邮件退订用户。



URL


<主> https://api.mysubmail.com/addressbook/mail/unsubscribe
<备> https://api.submail.cn/addressbook/mail/unsubscribe


支持格式


格式URL
jsonhttps://api.mysubmail.com/addressbook/mail/unsubscribe.json(默认)
xmlhttps://api.mysubmail.com/addressbook/mail/unsubscribe.xml


http 请求方式


POST


是否需要授权


参阅 API 授权和验证机制


请求参数


参数类型必需/可选默认描述
appidstring必需在 SUBMAIL 应用集成中创建的邮件应用ID
addressstring必需联系人邮件地址
e.g. leo leo@submail.cn
SUBMAIL 支持完整的 RFC 822 收件人标准,请确保您的邮件地址的有效性。
请参见 维基百科 EMAIL ADDRESS RFC822 文档
targetstring可选unsubscribe地址簿标识,将联系人从目标地址簿移除
忽略此参数,SUBMAIL 默认将联系人添加到退订地址簿。
请参见 获取项目或地址簿的开发者标识
timestampUNIX 时间戳必需参阅 API 授权与验证机制 > Timestamp UNIX 时间戳
sign_typestring可选normalAPI 授权模式( md5 or sha1 or normal
参阅 API 授权与验证机制 > 授权和验证方式
signaturestring必需应用密匙 数字签名
参阅 API 授权与验证机制 > 授权和验证方式


代码示例


添加一个邮件联系人到退订地址簿


POST
https://api.mysubmail.com/addressbook/mail/unsubscribe.json


POST Data
appid=your_app_id
&address=leo@submail.cn
&signature=your_app_key


返回
{
    "status":"success"
}


从目标地址簿移除一个邮件联系人


POST
https://api.mysubmail.com/addressbook/mail/unsubscribe.json


POST Data
appid=your_app_id
&address=leo@submail.cn
⌖=ThJBE4
&signature=your_app_key


返回
{
    "status":"success"
}


使用 CURL 添加一个邮件联系人到退订地址簿


发送 CURL
curl -d 'appid=your_app_id&address=leo@submail.cn&signature=your_app_key' https://api.mysubmail.com/addressbook/mail/unsubscribe.json


返回
{
      "status":"success"
}


使用 CURL 从目标地址簿移除一个邮件联系人


发送 CURL
curl -d 'appid=your_app_id&address=leo@submail.cn⌖=ThJBE4&signature=your_app_key' https://api.mysubmail.com/addressbook/mail/unsubscribe.json


返回
{
      "status":"success"
}


返回值


请求成功
{
      "status":"success"
}


请求失败
{
      "status":"error",
      "code":"1xx",
      "msg":"error message"
}


错误代码


参阅 API 错误代码