logo
เอกสาร
ค้นหา

Route

You can use the API to query, add, modify, and delete receiving routes. The route you configured needs to be recorded through MX configuration first. We can forward reply message to the mailbox you specify or push the message to the specified URL.

Query( batch)

URL

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

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

HTTP Request Method

GET
              
              GET

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

Header

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

Parameter Description

parameter type required or not description
offset int no offset position, [0-], defaults to 0
limit int no amount, [0-100],defaults to 100

Request Example

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

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

Returned Value Description

parameter description
route_id route ID
expression receiving route
action URL/Email
api_user_route When the action is set to "Email" this parameter is required.

Returned Value Example:

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
 }

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

Query

URL

https://email.api.engagelab.cc/v1/routes/{route_id}
              
              https://email.api.engagelab.cc/v1/routes/{route_id}

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

HTTP Request Method

GET
              
              GET

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

Header

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

Request Example

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" 

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

Returned Value Description

parameter description
route_id route ID
expression receiving route
action URL/Email
api_user_route When the action is set to "Email" this parameter is required.

Returned Value Example:

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

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

Add

A user can add up to 1000 receiving routes.

URL

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

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

HTTP Request Method

POST
              
              POST

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

Header

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

Parameter Description

parameter type required or not description
expression string yes receiving route. Format is 'regular expression@domain'; it can also be a specific email address. The domain/email domain must be a verified or usable sending domain.
action string yes URL/Email
api_user_route string * When the action is set to "Email" this parameter is required. When forwarding to an email, this API-USER will be used for forwarding and sending.

Request Example

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

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

Returned Value Description

parameter description
route_id route ID
expression receiving route
action URL /Email
api_user_route When the action is set to "Email" this parameter is required.

Returned Value Example:

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

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

Modify

URL

https://email.api.engagelab.cc/v1/routes/{route_id}
              
              https://email.api.engagelab.cc/v1/routes/{route_id}

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

HTTP Request Method

PUT
              
              PUT

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

Header

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

Parameter Description

parameter type required or not description
expression string * receiving route
action string * URL/ Email
api_user_route string * When the action is set to "Email" this parameter is required.

Request Example

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

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

Returned Value Description

parameter description
count count of modified receiving route

Returned Value Example:

Response-success

HTTP Status: 200

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

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

Response-error

HTTP Status :401

{ "code": 30000, "message": "Authentication failed." }
              
                        
{
    "code": 30000,
    "message": "Authentication failed."
}

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

Delete

URL

https://email.api.engagelab.cc/v1/routes/{route_id}
              
              https://email.api.engagelab.cc/v1/routes/{route_id}

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

HTTP Request Method

DELETE
              
              DELETE

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

Header

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

Request Example

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

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

Returned Value Description

parameter description
count count of deleted receiving route

Returned Value Example:

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

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