收信路由
您可以使用 API 对收信路由进行查询,添加,修改, 删除; 您配置的路由需要先通过MX配置记录; 我们可以将回复邮件转发到您指定的邮箱,或将邮件推送到指定的URL。
调用地址
| 数据中心 | URL | 
|---|---|
| 新加坡 | https://email.api.engagelab.cc | 
| 土耳其 | https://emailapi-tr.engagelab.com | 
当使用 REST API 时,需要将选定的 base URL 与具体 API 的路径结合起来获得完整的调用地址。
POST/v1/routes
查询( 批量)
URL
https://email.api.engagelab.cc/v1/routes
            
              
              https://email.api.engagelab.cc/v1/routes
            
            此代码块在浮窗中显示
        HTTP 请求方式
GET
            
              
              GET
            
            此代码块在浮窗中显示
        Header
| Header | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| Authorization | String | true | Basic base64(api_user:api_key) | 
查询(批量)参数说明
| 参数 | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| offset | int | 否 | 查询起始位置,[0-],默认为 0 | 
| limit | int | 否 | 查询个数,取值区间 [0-100] ,默认为 100 | 
请求示例
curl "https://email.api.engagelab.cc/v1/routes?offset=0&limit=200" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
            
              
              curl "https://email.api.engagelab.cc/v1/routes?offset=0&limit=200" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
            
            此代码块在浮窗中显示
        响应说明
| 参数 | 说明 | 
|---|---|
| route_id | 路由 ID | 
| expression | 收信路由 | 
| action | URL/邮箱 | 
| api_user_route | 当action设置为“邮箱”时,此参数必填 | 
响应示例:
Response-success HTTP Status: 200
{
       "result": [
            {    
                "route_id": 1,
                "expression":"xjmfc",
                "action":"test@engagelab.com"
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800",
                "api_user_route":"test"
            }
        ],
        "total": 1,
        "count": 1
 }
            
              
              {
       "result": [
            {    
                "route_id": 1,
                "expression":"xjmfc",
                "action":"test@engagelab.com"
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800",
                "api_user_route":"test"
            }
        ],
        "total": 1,
        "count": 1
 }
            
            此代码块在浮窗中显示
        查询
URL
https://email.api.engagelab.cc/v1/routes/{route_id}
            
              
              https://email.api.engagelab.cc/v1/routes/{route_id}
            
            此代码块在浮窗中显示
        HTTP 请求方式
GET
            
              
              GET
            
            此代码块在浮窗中显示
        Header
| Header | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| Authorization | String | true | Basic base64(api_user:api_key) | 
请求示例
curl -X GET "https://email.api.engagelab.cc/v1/routes/112" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
            
              
              curl -X GET "https://email.api.engagelab.cc/v1/routes/112" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
            
            此代码块在浮窗中显示
        响应说明
| 参数 | 说明 | 
|---|---|
| route_id | 路由 ID | 
| expression | 收信路由 | 
| action | URL/邮箱 | 
| api_user_route | 当action设置为“邮箱”时,此参数必填 | 
响应示例:
Response-success
HTTP Status: 200
{
       "result": {    
                "route_id": 1,
                "expression":"xjmfc",
                "action":"test@engagelab.com",
                "api_user_route": "sctest",
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800"
          }
 }
            
              
              {
       "result": {    
                "route_id": 1,
                "expression":"xjmfc",
                "action":"test@engagelab.com",
                "api_user_route": "sctest",
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800"
          }
 }
            
            此代码块在浮窗中显示
        添加
一个用户最多能添加1000个收信路由。
URL
https://email.api.engagelab.cc/v1/routes
            
              
              https://email.api.engagelab.cc/v1/routes
            
            此代码块在浮窗中显示
        HTTP 请求方式
POST
            
              
              POST
            
            此代码块在浮窗中显示
        Header
| Header | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| Authorization | String | true | Basic base64(api_user:api_key) | 
添加参数说明
| 参数 | 类型 | 必须 | 说明 | 
|---|---|---|---|
| expression | string | 是 | 收信路由。格式为“正则表达式@域名”;也可以为具体的邮箱。域名/邮箱域名需是已验证或可使用的发信域名 | 
| action | string | 是 | URL/邮箱 | 
| api_user_route | string | * | 当action设置为“邮箱”时,此参数必填 | 
请求示例
curl -X POST "https://email.api.engagelab.cc/v1/routes" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "expression":"hongkong@aizl.net",
  "action":"test@engagelab.com"
}'
            
              
              curl -X POST "https://email.api.engagelab.cc/v1/routes" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "expression":"hongkong@aizl.net",
  "action":"test@engagelab.com"
}'
            
            此代码块在浮窗中显示
        响应说明
| 参数 | 说明 | 
|---|---|
| route_id | 路由ID | 
| expression | 收信路由 | 
| action | URL /邮箱 | 
| api_user_route | 当action设置为“邮箱”时,此参数必填,转信到邮箱时,将使用此API_USER进行转信发送 | 
响应示例:
{
   "result": {
            "route_id": 598802,
            "expression":".*@123.com",
            "action":"test@engagelab.com"
            "api_user_route":"test233"
            "create_time": "2022-11-14T14:27:34+0800",
            "update_time": "2022-11-14T14:27:34+0800"
    }
}
            
              
              {
   "result": {
            "route_id": 598802,
            "expression":".*@123.com",
            "action":"test@engagelab.com"
            "api_user_route":"test233"
            "create_time": "2022-11-14T14:27:34+0800",
            "update_time": "2022-11-14T14:27:34+0800"
    }
}
            
            此代码块在浮窗中显示
        修改
URL
https://email.api.engagelab.cc/v1/routes/{route_id}
            
              
              https://email.api.engagelab.cc/v1/routes/{route_id}
            
            此代码块在浮窗中显示
        HTTP 请求方式
PUT
            
              
              PUT
            
            此代码块在浮窗中显示
        Header
| Header | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| Authorization | String | true | Basic base64(api_user:api_key) | 
修改参数说明
| 参数 | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| expression | string | * | 收信路由 | 
| action | string | * | URL/邮箱 | 
| api_user_route | string | * | 当action设置为“邮箱”时,此参数必填 | 
请求示例
curl -X PUT "https://email.api.engagelab.cc/v1/routes/12333" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "expression":"travel",
  "action":"test@engagelab.com"
}'
            
              
              curl -X PUT "https://email.api.engagelab.cc/v1/routes/12333" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "expression":"travel",
  "action":"test@engagelab.com"
}'
            
            此代码块在浮窗中显示
        响应说明
| 参数 | 说明 | 
|---|---|
| count | 修改的收信路由数量 | 
响应示例:
Response-success
HTTP Status: 200
{
    "count": 1
}
            
              
              {
    "count": 1
}
            
            此代码块在浮窗中显示
        Response-error
HTTP Status :401
          
{
    "code": 30000,
    "message": "Authentication failed."
}
            
              
                        
{
    "code": 30000,
    "message": "Authentication failed."
}
            
            此代码块在浮窗中显示
        删除
URL
https://email.api.engagelab.cc/v1/routes/{route_id}
            
              
              https://email.api.engagelab.cc/v1/routes/{route_id}
            
            此代码块在浮窗中显示
        HTTP 请求方式
DELETE
            
              
              DELETE
            
            此代码块在浮窗中显示
        Header
| Header | 类型 | 是否必须 | 说明 | 
|---|---|---|---|
| Authorization | String | true | Basic base64(api_user:api_key) | 
请求示例
curl -X DELETE "https://email.api.engagelab.cc/v1/routes/21122" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
            
              
              curl -X DELETE "https://email.api.engagelab.cc/v1/routes/21122" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
            
            此代码块在浮窗中显示
        响应说明
| 参数 | 说明 | 
|---|---|
| count | 已删除的收信路由数量 | 
响应示例:
         
{
    "count": 1
}
            
              
                       
{
    "count": 1
}
            
            此代码块在浮窗中显示
        







