取消訂閱

最新更新:2023-08-10

當用戶選擇退訂郵件時, 他的郵件地址就會被添加到此列表中.

在此列表中的郵件地址, 都不會再被發送郵件.

你可以對此列表進行查詢, 刪除, 添加操作

查詢

URL

https://email.api.engagelab.cc/v1/unsubscribes
          https://email.api.engagelab.cc/v1/unsubscribes

        
此代碼塊在浮窗中顯示

HTTP 請求方式

GET
          GET

        
此代碼塊在浮窗中顯示

Header

Header 類型 是否必需 描述
Authorization string 基本 base64(api_user:api_key)

查詢參數說明

參數 類型 是否必需 描述
start_date string * 開始日期(格式:yyyy-MM-dd)
end_date string * 結束日期(格式:yyyy-MM-dd)
email string * 郵件地址,例如,22@gmail.com
api_user string 指定的 API 用戶,默認為 all
offset int 起始位置 [0-],默認為 0
limit int 數量 [0-100],默認為 100

提示:

  1. 查詢的天數不超過三個月.。
  2. 使用給定的電子郵件地址進行搜索時,時間區間參數失效。

請求示例

curl -X GET -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: 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: YXBpX3VzZXI6YXBpX2tleQ==' 
     'https://email.api.engagelab.cc/v1/unsubscribes?offset=0&limit=30'

        
此代碼塊在浮窗中顯示

返回值說明

參數 描述
email 郵件地址
api_user API 用戶
type 取消訂閱類型 (0, 1, 2, 3)
unsubscribe_time 取消訂閱發生的時間
expire_time 取消訂閱攔截的過期時間
類型 描述
0 我不想再收到此類郵件
1 這不是我訂閱的
2 這是垃圾郵件
3 這是欺詐郵件,我想舉報

返回值示例

{ "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
}

        
此代碼塊在浮窗中顯示

添加

URL

https://email.api.engagelab.cc/v1/unsubscribes
          https://email.api.engagelab.cc/v1/unsubscribes

        
此代碼塊在浮窗中顯示

Content-Type:

Content-Type: application/json;charset=utf-8
          Content-Type: application/json;charset=utf-8

        
此代碼塊在浮窗中顯示

HTTP 請求方法

POST
          POST

        
此代碼塊在浮窗中顯示

Header

Header 類型 是否必需 描述
Authorization string 基本 base64(api_user:api_key)

請求體參數說明

參數 類型 是否必需 描述
email string 要添加的郵件地址
expire_time string 取消訂閱攔截的過期時間(格式:yyyy-MM-dd)

請求示例

curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: 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: YXBpX3VzZXI6YXBpX2tleQ==' 
     --data '{"email": "xjmfc23@126.com","expire_time":"2023-12-31"}'
     'https://email.api.engagelab.cc/v1/unsubscribes'

        
此代碼塊在浮窗中顯示

返回值說明

參數 描述
email 郵件地址
api_user API_USER
unsubscribe_time 取消訂閱時間
expire_time 過期時間

返回值示例

{ "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"
    }
}

        
此代碼塊在浮窗中顯示

刪除

URL

https://email.api.engagelab.cc/v1/unsubscribes
          https://email.api.engagelab.cc/v1/unsubscribes

        
此代碼塊在浮窗中顯示

HTTP 請求方法

DELETE
          DELETE

        
此代碼塊在浮窗中顯示

請求頭

Header 類型 是否必需 描述
Authorization string 基本 base64(api_user:api_key)

請求體參數說明

參數 類型 是否必需 描述
email string * 要刪除的電子郵件地址
start_date string * 開始日期(格式:yyyy-MM-dd)
end_date string * 結束日期(格式:yyyy-MM-dd)

請求示例

curl -X DELETE -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' --data '{"start_date": "2023-04-06","end_date":"2023-07-06", "email": "example1@example.com"}' 'https://email.api.engagelb.cc/v1/unsubscribes'
          curl -X DELETE -H 'Content-Type: application/json; charset=utf-8' 
     -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' 
     --data '{"start_date": "2023-04-06","end_date":"2023-07-06", "email": "example1@example.com"}'
     'https://email.api.engagelb.cc/v1/unsubscribes'

        
此代碼塊在浮窗中顯示

返回值說明

參數 說明
count 已刪除地址的數量

返回值示例:

響應成功

HTTP 狀態:200

{ "count": 1 }
          {
    "count": 1
}

        
此代碼塊在浮窗中顯示

響應錯誤

HTTP 狀態:401

{ "code": 30000, "message": "未經授權。" }
          {
    "code": 30000,
    "message": "未經授權。"
}


        
此代碼塊在浮窗中顯示
在文档中心打开