Unsubscribe
When a user chooses to unsubscribe, his email address will be added to this list
The email addresses in this list will be blocked by the system, and the failures will be classified as 无效邮件-取消订阅(worker:address in unsubscribe list)
.
You can query, delete and add address in the list.
Query
URL
https://api.sendcloud.net/apiv2/unsubscribe/list
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
days | int | * | stats in the past days (days=1 means today) |
startDate | string | * | format of start date is yyyy-MM-dd |
endDate | string | * | format of end date is yyyy-MM-dd |
string | * | learn more about the address in the list | |
apiUserList | string | no | obtain stats of specified API_USER; multiple API_USERs are separated by semicolons, e.g.apiUserList=a;b;c |
labelIdList | string | no | obtain stats with specified labels; multiple labels are separated by semicolons, e.g. labelIdList=a;b;c |
labelNameList | string | no | obtain stats of specified label name; multiple labels are separated by semicolons(the Chinese character is encoded in UTF-8), for example,labelNameList=a;b;c |
start | int | no | start position, [0-], defaults to 0 |
limit | int | no | amount, [0-100],defaults to 100 |
TIPS:
1.With designated time frame, you are to search within the period of time. Note:start_date and end_date or days is required. 2. Time frame cannot be longer than 3 months. 3. With given email address, you are to search the details of this email address. Note: time frame is invalid now.
Request Example
https://api.sendcloud.net/apiv2/unsubscribe/list?apiUser=***&apiKey=***&apiUserList=[***;***]&days=100&start=0&limit=3
Returned value description
parameter | description |
---|---|
email address | |
domain | domain corresponding to the email address |
labelId | label ID |
labelId | label Name |
apiUser | apiUser name |
unsubscribeTime | time to unsubscribe |
unsubscribeType | Unsubscribe classification |
unsubscribeTypeDesc | Unsubscribe classification description |
expireTime | When the sendcloud blacklist expires |
Returned Value Example
{
"result": true,
"statusCode": 200,
"message": "请求成功",
"info": {
"dataList": [
{
"email": "cxybfq@163.com",
"unsubscribeTime": "2021-07-15 17:55:20",
"expireTime": "2021-07-15 17:55:20",
"domain": "163.com",
"labelId": 0,
"labelId": "",
"apiUser": "delong_test",
"unsubscribeType": 0,
"unsubscribeTypeDesc": "我不想再收到此类邮件"
}
],
"count": 1
}
}
Add
URL
https://api.sendcloud.net/apiv2/unsubscribe/add
HTTP Request Method
POST get
Returned value Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
string | yes | email addresses to add | |
expireTime | string | yes | Expiration time of unsubscribe interception, format is yyyy MM DD |
Request Example
https://api.sendcloud.net/apiv2/unsubscribe/add?apiUser=***&apiKey=***&email=abc@qq.com
Returned value description
parameter | description |
---|---|
email address | |
domain | domain corresponding to the email address |
labelId | label ID |
apiUser | API_USER |
unsubscribeTime | time to unsubscribe |
expireTime | Expiration time of unsubscribe interception, format is yyyy MM DD |
Returned Value Example
{
"result": true,
"statusCode": 40401,
"message": "取消订阅记录创建成功",
"info": {
"data": {
"email": "cxybfq@163.com",
"unsubscribeTime": "2021-07-19 17:51:10",
"expireTime": "2021-07-01 00:00:00",
"domain": "163.com",
"labelId": 0,
"apiUser": "xiaojinmin",
"unsubscribeType": 0,
"unsubscribeTypeDesc": "我不想再收到此类邮件"
}
}
}
Delete
URL
https://api.sendcloud.net/apiv2/unsubscribe/delete
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
days | int | * | stats in the past days (days=1 means today) |
startDate | string | * | format of start date is yyyy-MM-dd |
endDate | string | * | format of end date is yyyy-MM-dd |
string | * | delete the email address |
TIPS:
- With specified time frame, you are to delete all unsubscribed addresses within the period of time. Note: start_date and end_date, or days is required.
- Time frame cannot be longer than 3 months.
- With given email address, you are to delete the email address from the list. Note: time frame is invalid now.
Request Example
https://api.sendcloud.net/apiv2/unsubscribe/delete?apiUser=***&apiKey=*** &email=test@sendcloud.com
Returned Value Description
parameter | description |
---|---|
count | count of deleted addresses |
Returned Value Example
{
"statusCode":200,
"info":{"count":1},
"message":"请求成功",
"result":true
}