Email Label
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
HTTP Request Method
GET
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>>"
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"
}
]
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Authentication failed."
}
Query
URL
https://email.api.engagelab.cc/v1/labels/{label_id}
HTTP Request Method
GET
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>>"
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"
}
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Authentication failed."
}
Add
URL
https://email.api.engagelab.cc/v1/labels
Content-Type:
application/json; charset=utf-8
HTTP Request Method
POST
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",
}'
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"
}
}
Response-error
HTTP Status :400
{
"code": 30105,
"message": "The label name should be 1-255 characters"
}
Delete
URL
https://email.api.engagelab.cc/v1/labels/{label_id}
HTTP Request Method
DELETE
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>>"
Returned Value Description
Parameter | Description |
---|---|
count | amount of deleted labels |
Returned Value Example
Response-success
HTTP Status: 200
{
"count": 1
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Authentication failed."
}
Modify
URL
https://email.api.engagelab.cc/v1/labels/{label_id}
HTTP Request Method
PUT
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",
}'
Returned Value Description
Parameter | Description |
---|---|
count | count of modified labels |
Returned Value Example
Response-success
HTTP Status: 200
{
"count": 1
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Authentication failed."
}