Email Label

Last updated:2023-03-14

Label provides another way to get stats of emails.

You can query, add, delete and modify labels with API.

Query(Batch)

List of returned labels

URL

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

        
This code block in the floating window

HTTP Request Method

GET
          GET

        
This code block in the floating window

Request Header

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

Query 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
label_name string no fuzzy query

Request Example

curl "https://email.api.engagelab.cc/v1/labels?label_name=edm&offset=0&limit=200" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl "https://email.api.engagelab.cc/v1/labels?label_name=edm&offset=0&limit=200" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

Parameter Description
label_id label ID
label_name label name
create_time time of label creation
update_time time of label modification

Returned Value Example

Response-success

HTTP Status: 200

{ "total": 28, "count": 28, "result": [ { "label_id": 598802, "label_name": "xjm226", "create_time": "2022-11-14T14:27:48+0800", "update_time": "2022-11-14T14:27:48+0800" } ] }
          {
       
       "total": 28,
        "count": 28,
        "result": [
            {
                "label_id": 598802,
                "label_name": "xjm226",
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800"
            }
        ]
 }

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Unauthorized." }
          {  
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window

Query

URL

https://email.api.engagelab.cc/v1/labels/{label_id}
          https://email.api.engagelab.cc/v1/labels/{label_id}

        
This code block in the floating window

HTTP Request Method

GET
          GET

        
This code block in the floating window

Request Headers

Header Type Required Description
Authorization String true Basic base64(apiUser:apiKey)

Request Example

curl "https://email.api.engagelab.cc/v1/labels/89" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl "https://email.api.engagelab.cc/v1/labels/89" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

Parameter Description
label_id label ID
label_name label name
create_time time of label creation
update_time time of label modification

Returned Value Example

Response-success

HTTP Status: 200

{ "result": { "label_id": 598100, "label_name": "xiaoxiao" "create_time": "2022-08-09T13:49:46+0800", "update_time": "2022-11-12T14:12:12+0800" } }
          {
        "result": {
            "label_id": 598100,
            "label_name": "xiaoxiao"
            "create_time": "2022-08-09T13:49:46+0800",
            "update_time": "2022-11-12T14:12:12+0800"
          }
    
}

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Unauthorized." }
          {
    
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window

Add

URL

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

        
This code block in the floating window

Content-Type:

application/json; charset=utf-8
          application/json; charset=utf-8

        
This code block in the floating window

HTTP Request Method

POST
          POST

        
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
label_name string yes label name to be added. Maximum  64 characters.

Tips: The upper limit of label creation is 100000

Request Example

curl -X POST "https://email.api.engagelab.cc/v1/labels" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json" --data '{ "label_name":"hongkong", }'
          curl -X POST "https://email.api.engagelab.cc/v1/labels" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "label_name":"hongkong",
}'

        
This code block in the floating window

Returned Value Description

Parameter Description
label_id label ID
label_name label name
create_time time of label creation
update_time time of label modification

Returned Value Example

Response-success

HTTP Status: 200

{ "result": { "label_id": 598802, "label_name": "xjm226", "create_time": "2022-11-14T14:27:34+0800", "update_time": "2022-11-14T14:27:34+0800" } }
          
{
    "result": {
            "label_id": 598802,
            "label_name": "xjm226",
            "create_time": "2022-11-14T14:27:34+0800",
            "update_time": "2022-11-14T14:27:34+0800"
    }
    
}

        
This code block in the floating window

Response-error

HTTP Status :400

{ "code": 30105, "message": "The label name should be 1-255 characters" }
          {
    "code": 30105,
    "message": "The label name should be 1-255 characters"
}

        
This code block in the floating window

Delete

URL

https://email.api.engagelab.cc/v1/labels/{label_id}
          https://email.api.engagelab.cc/v1/labels/{label_id}

        
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)

Request Example

curl -X DELETE "https://email.api.engagelab.cc/v1/labels/21122" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl -X DELETE "https://email.api.engagelab.cc/v1/labels/21122" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

Parameter Description
count amount of deleted labels

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": "Unauthorized." }
          {
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window

Modify

URL

https://email.api.engagelab.cc/v1/labels/{label_id}
          https://email.api.engagelab.cc/v1/labels/{label_id}

        
This code block in the floating window

HTTP Request Method

PUT
          PUT

        
This code block in the floating window

Request Header

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

Parameter Description

Parameter Type Required Description
label_name string yes new label name. Maximum  64 characters.

Request Example

curl -X PUT "https://email.api.engagelab.cc/v1/labels/12333" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json" --data '{ "label_name":"travel", }'
          curl -X PUT "https://email.api.engagelab.cc/v1/labels/12333" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "label_name":"travel",
}'

        
This code block in the floating window

Returned Value Description

Parameter Description
count count of modified labels

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": "Unauthorized." }
          {
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window
在文档中心打开