# Unsubscribe
When recipient unsubscribes an email, his address will be added into the unsubscribe list.
No more email will be sent to the unsubscribed email address.
You can query, delete and add address in the list.
# Query
URL
https://api2.sendcloud.net/api/unsubscribe/list
1
HTTP Request Method
post get
1
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:
- With designated time frame, you are to search 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 search the details of this email address. Note: time frame is invalid now.
Request Example:
http://api2.sendcloud.net/api/unsubscribe/list?apiUser=***&apiKey=***&apiUserList=[***;***]&days=100&start=0&limit=3
1
Returned Value Description
parameter | description |
---|---|
email address | |
domain | domain corresponding to the email address |
labelId | label ID |
apiUser | apiUser name |
unsubscribeTime | Unsubscribe time |
unsubscribeType | The type of Unsubscribe |
unsubscribeTypeDesc | The description of the type |
unsubscribeType | unsubscribeTypeDesc |
---|---|
0 | I don't want to receive such email anymore |
1 | I didn't subscribe it |
2 | This is a spam email |
3 | This is a fraud email, i want to report it |
Returned Value Example:
{
"result": true,
"statusCode": 200,
"message": "success",
"info": {
"dataList": [
{
"email": "524244185@qq.com",
"unsubscribeTime": "2021-01-12 17:03:23",
"domain": "qq.com",
"labelId": 0,
"apiUser": "delong_test",
"unsubscribeType": 0,
"unsubscribeTypeDesc": "I don't want to receive such mail anymore."
}
],
"count": 1
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Add
URL
https://api2.sendcloud.net/api/unsubscribe/add
1
HTTP Request Method
POST get
1
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
string | yes | email addresses to add |
Request Example:
https://api2.sendcloud.net/api/unsubscribe/add?apiUser=***&apiKey=***&email=abc@qq.com
1
Returned value Description
parameter | description |
---|---|
email address | |
domain | domain corresponding to the email address |
labelId | label ID |
apiUser | API_USER |
unsubscribeTime | Unsubscribe time |
Returned Value Example:
{
"statusCode":40401,
"info": {
"data":
{
"email": "abc@qq.com",
"domain": "qq.com",
"labelId": 0,
"apiUser": "api_user",
"unsubscribeTime": "2014-11-19 10:57:24"
}
}
"result":true,
"message":"request was successful"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Delete
URL
https://api2.sendcloud.net/api/unsubscribe/delete
1
HTTP Request Method
post get
1
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://api2.sendcloud.net/api/unsubscribe/delete?apiUser=***&apiKey=*** &email=test@sendcloud.com
1
Returned Value Description
parameter | description |
---|---|
count | count of deleted addresses |
Returned Value Example:
{
"statusCode":200,
"info":{"count":1},
"message":"request was successful",
"result":true
}
1
2
3
4
5
6
2
3
4
5
6