Blocks API

อัพเดทล่าสุด :2023-08-10

If you encounter malicious registration and do not want to send emails to certain addresses or mailboxes, you can add the domain or specific email address to the block list. Email addresses in this list will be blocked by the system. You can query, add, and delete entries in this list.

Query

URL

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

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

HTTP Request Method

GET
          GET

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

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, formatted with yyyy-MM-dd
end_date string * End date, formatted with yyyy-MM-dd
email_or_domain string * Emails or domains (e.g., 11@gmail.com, hotmail.com)
api_user string no Block API_USER, defaults to all
offset int no Start [0-100], defaults to 100
limit int no Amount [0-100], defaults to 100

Tips:

  • The time frame cannot be longer than 3 months.

Request Example:

curl -X GET -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' 'https://email.api.engagelab.cc/v1/blocks?offset=0&limit=1'
          curl -X GET -H 'Content-Type: application/json; charset=utf-8' 
     -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' 
     'https://email.api.engagelab.cc/v1/blocks?offset=0&limit=1'

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Returned Value Description

Parameter Description
api_user Block API_USER
email_or_domain Blocked email or domain
create_time Creation time
expire_time Expiration time

Returned Value Example

{ "result": [ { "block_id": 122, "api_user": "all", "email_or_domain": "11@gmail.com", "create_time": "2021-03-01 17:24:34", "expire_time": "2021-10-01 00:00:00" },{ "block_id": 123, "api_user": "all", "email_or_domain": "hotmail.com", "create_time": "2021-03-01 17:24:34", "expire_time": "2021-10-01 00:00:00" },{ "block_id": 124, "api_user": "all", "email_or_domain": "22@yahoo.com", "create_time": "2021-03-01 17:24:34", "expire_time": "2021-10-01 00:00:00" }, ], "count": 3, "total": 10 }
          {
  "result": [
    {
      "block_id": 122,
      "api_user": "all",
      "email_or_domain": "11@gmail.com",
      "create_time": "2021-03-01 17:24:34",
      "expire_time": "2021-10-01 00:00:00"
    },{
      "block_id": 123,
      "api_user": "all",
      "email_or_domain": "hotmail.com",
      "create_time": "2021-03-01 17:24:34",
      "expire_time": "2021-10-01 00:00:00"
    },{
      "block_id": 124,
      "api_user": "all",
      "email_or_domain": "22@yahoo.com",
      "create_time": "2021-03-01 17:24:34",
      "expire_time": "2021-10-01 00:00:00"
    },
  ],
  "count": 3,
  "total": 10
}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Add

URL

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

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

HTTP Request Method

POST
          POST

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Body Parameter Description

Parameter Type Required or not Description
api_user string no Block API_USER, defaults to all
email_or_domain array yes Emails or domains (e.g., ["11@gmail.com","hotmail.com","22@yahoo.com"])
expire_time string yes Expiration time, formatted with yyyy-MM-dd

Request Example:

curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' --data '{"api_user": "123456abc","email_or_domain": ["11@gmail.com","hotmail.com","22@yahoo.com"],"expire_time":"2023-12-31"}' 'https://email.api.engagelab.cc/v1/blocks'
          curl -X POST -H 'Content-Type: application/json; charset=utf-8' 
     -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' 
     --data '{"api_user": "123456abc","email_or_domain": ["11@gmail.com","hotmail.com","22@yahoo.com"],"expire_time":"2023-12-31"}'
     'https://email.api.engagelab.cc/v1/blocks'

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Returned Value Description

Parameter Description
api_user Block API_USER
email_or_domain Email or domain
create_time Creation time
expire_time Expiration time

Returned Value Example

{ "result": [ { "api_user": "all", "email_or_domain": "11@gmail.com", "create_time": "2021-03-01 17:24:34", "expire_time": "2021-10-01 00:00:00" },{ "api_user": "all", "email_or_domain": "hotmail.com", "create_time": "2021-03-01 17:24:34", "expire_time": "2021-10-01 00:00:00" },{ "api_user": "all", "email_or_domain": "22@yahoo.com", "create_time": "2021-03-01 17:24:34", "expire_time": "2021-10-01 00:00:00" } ] }
          {
   "result": [
    {
      "api_user": "all",
      "email_or_domain": "11@gmail.com",
      "create_time": "2021-03-01 17:24:34",
      "expire_time": "2021-10-01 00:00:00"
    },{
      "api_user": "all",
      "email_or_domain": "hotmail.com",
      "create_time": "2021-03-01 17:24:34",
      "expire_time": "2021-10-01 00:00:00"
    },{
      "api_user": "all",
      "email_or_domain": "22@yahoo.com",
      "create_time": "2021-03-01 17:24:34",
      "expire_time": "2021-10-01 00:00:00"
    }
    ]
}

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Delete blocks

URL

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

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

HTTP Request Method

DELETE
          DELETE

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Body Parameter Description

Parameter Type Required or not Description
api_user string no Block API_USER
email_or_domain array yes Blocked receiving domains or email addresses

Request Example:

curl -X DELETE -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' --data '{"api_user":"123456abc","email_or_domain":["xjmfc@example.com","gmail.com"]}' 'https://email.api.engagelab.cc/v1/blocks'
          curl -X DELETE -H 'Content-Type: application/json; charset=utf-8' 
     -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' 
     --data '{"api_user":"123456abc","email_or_domain":["xjmfc@example.com","gmail.com"]}'
     'https://email.api.engagelab.cc/v1/blocks'

        
โค้ดนี้โชว์เป็นหน้าต่างลอย

Returned Value Description

Parameter Description
count Number of successfully deleted items

Returned Value Example

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

        
โค้ดนี้โชว์เป็นหน้าต่างลอย
在文档中心打开