Unsubscribes API
Last updated:2023-08-10
When a recipient unsubscribes from an email, their address will be added to the unsubscribe list. No more emails will be sent to the unsubscribed email address. You can query, delete, and add addresses in the list.
Query
URL
https://email.api.engagelab.cc/v1/unsubscribes
https://email.api.engagelab.cc/v1/unsubscribes
This code block in the floating window
HTTP Request Method
GET
GET
This code block in the floating window
Header
Header | Type | Required | Description |
---|---|---|---|
Authorization | String | true | Basic base64(api_user:api_key) |
Query Parameter Description
Parameter | Type | Required or not | Description |
---|---|---|---|
start_date | string | * | Start date (format: yyyy-MM-dd) |
end_date | string | * | End date (format: yyyy-MM-dd) |
string | * | Email address, e.g, 22@gmail.com |
|
api_user | string | no | specified API_USER, defaults to all |
offset | int | no | Start position [0-], defaults to 0 |
limit | int | no | Amount [0-100], defaults to 100 |
Tips:
- The time frame cannot be longer than 3 months.
- When searching with a given email address, the time frame is ignored.
Request Example:
curl -X GET -H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
'https://email.api.engagelab.cc/v1/unsubscribes?offset=0&limit=30'
curl -X GET -H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
'https://email.api.engagelab.cc/v1/unsubscribes?offset=0&limit=30'
This code block in the floating window
Returned Value Description
Parameter | Description |
---|---|
Email address | |
api_user | API_USER |
type | Type of unsubscribe (0, 1, 2, 3) |
unsubscribe_time | Timestamp of when the unsubscribe occurred |
expire_time | Expiration time for unsubscribe interception |
Type | Description |
---|---|
0 | I don't want to receive such email anymore |
1 | I didn't subscribe to it |
2 | This is a spam email |
3 | This is a fraud email, I want to report it |
Returned Value Example:
{
"result": [
{
"email": "524244185@qq.com",
"unsubscribe_time": "2021-01-12T17:03:23+08:00",
"expire_time": "2023-01-12T17:03:23+08:00",
"api_user": "delong_test",
"type": 0
}
],
"count": 1,
"total": 1
}
{
"result": [
{
"email": "524244185@qq.com",
"unsubscribe_time": "2021-01-12T17:03:23+08:00",
"expire_time": "2023-01-12T17:03:23+08:00",
"api_user": "delong_test",
"type": 0
}
],
"count": 1,
"total": 1
}
This code block in the floating window
Add
URL
https://email.api.engagelab.cc/v1/unsubscribes
https://email.api.engagelab.cc/v1/unsubscribes
This code block in the floating window
Content-Type:
Content-Type: application/json;charset=utf-8
Content-Type: application/json;charset=utf-8
This code block in the floating window
HTTP Request Method
POST
POST
This code block in the floating window
Header
Header | Type | Required | Description |
---|---|---|---|
Authorization | String | true | Basic base64(api_user:api_key) |
Body Parameter Description
Parameter | Type | Required or not | Description |
---|---|---|---|
string | yes | Email address to add | |
expire_time | string | yes | Expiration time of unsubscribe interception (format: yyyy-MM-dd) |
Request Example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
--data '{"email": "xjmfc23@126.com","expire_time":"2023-12-31"}'
'https://email.api.engagelab.cc/v1/unsubscribes'
curl -X POST -H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
--data '{"email": "xjmfc23@126.com","expire_time":"2023-12-31"}'
'https://email.api.engagelab.cc/v1/unsubscribes'
This code block in the floating window
Returned Value Description
Parameter | Description |
---|---|
Email address | |
api_user | API_USER |
unsubscribe_time | Unsubscribe time |
expire_time | Expire time |
Returned Value Example:
{
"result": {
"email": "abc@qq.com",
"api_user": "api_user",
"unsubscribe_time": "2014-11-19 10:57:24",
"expire_time": "2014-11-19 10:57:24"
}
}
{
"result": {
"email": "abc@qq.com",
"api_user": "api_user",
"unsubscribe_time": "2014-11-19 10:57:24",
"expire_time": "2014-11-19 10:57:24"
}
}
This code block in the floating window
Delete
URL
https://email.api.engagelab.cc/v1/unsubscribes
https://email.api.engagelab.cc/v1/unsubscribes
This code block in the floating window
HTTP Request Method
DELETE
DELETE
This code block in the floating window
Request Header
Header | Type | Required | Description |
---|---|---|---|
Authorization | String | true | Basic base64(api_user:api_key) |
Body Parameter Description
Parameter | Type | Required or not | Description |
---|---|---|---|
string | * | Email addresses to delete | |
start_date | string | * | Start date (format: yyyy-MM-dd) |
end_date | string | * | End date (format: yyyy-MM-dd) |
Request Example
curl -X DELETE -H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
--data '{"start_date": "2023-04-06","end_date":"2023-07-06", "email": "example1@example.com"}'
'https://email.api.engagelab.cc/v1/unsubscribes'
curl -X DELETE -H 'Content-Type: application/json; charset=utf-8'
-H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
--data '{"start_date": "2023-04-06","end_date":"2023-07-06", "email": "example1@example.com"}'
'https://email.api.engagelab.cc/v1/unsubscribes'
This code block in the floating window
Returned Value Description
Parameter | Description |
---|---|
count | Count of deleted addresses |
Returned Value Example:
Response-success
HTTP Status: 200
{
"count": 1
}
{
"count": 1
}
This code block in the floating window
Response-error
HTTP Status: 401
{
"code": 30000,
"message": "Authentication failed."
}
{
"code": 30000,
"message": "Authentication failed."
}
This code block in the floating window