Email Label
Label provides another way to get stats of emails.
You can query, add, delete and modify labels with API.
Query (Batch Query)
List of returned labels
URL
https://api.sendcloud.net/apiv2/label/list
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
query | string | no | key word of fuzzy query |
startDate | string | no | start date, yyyy-MM-dd |
endDate | string | 否 | end date, yyyy-MM-dd |
start | int | no | start position, [0-], defaults to 0 |
limit | int | no | amount, [0-100],defaults to 100 |
Request Example
https://api.sendcloud.net/apiv2/label/list?apiUser=***&apiKey=***&query=edm&start=0&limit=200
Returned Value Description
parameter | description |
---|---|
labelId | label ID |
labelName | label name |
gmtCreated | time of label creation |
gmtModified | time of label modification |
Returned Value Example
{
"info": {
"dataList": [
{
"gmtCreated": "2014-08-06 16:18:22",
"gmtUpdated": "2014-08-06 16:18:22",
"labelId": ***,
"labelName": "***"
},
{
"gmtCreated": "2014-08-06 15:13:28",
"gmtUpdated": "2014-08-06 15:13:28",
"labelId": ***,
"labelName": "***"
}
],
"total": 21,
"count": 2
},
"statusCode": 200,
"message": "请求成功",
"result": true
}
Query
URL
https://api.sendcloud.net/apiv2/label/get
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
labelId | int | yes | label ID |
Request Example
https://api.sendcloud.net/apiv2/label/get?apiUser=***&apiKey=***&labelId=89
Returned Value Description
parameter | description |
---|---|
labelId | label ID |
labelName | label name |
gmtCreated | time of label creation |
gmtModified | time of label modification |
Returned Value Example
{
"info": {
"data": {
"gmtCreated": "2014-08-06 16:18:22",
"gmtUpdated": "2014-08-06 16:18:22",
"labelId": ***,
"labelName": "***"
}
},
"statusCode": 200,
"message": "请求成功",
"result": true
}
Add
URL
https://api.sendcloud.net/apiv2/label/add
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
labelName | string | yes | label name to be added |
Tips: 1. The upper limit of label creation is 100000
Request Example
https://api.sendcloud.net/apiv2/label/add?apiUser=***&apiKey=***&labelName=test
Returned Value Description
parameter | description |
---|---|
labelId | label ID |
labelName | label name |
Returned Value Example
{
"statusCode": 200,
"info": {
"data": {
"gmtCreated": "2015-10-19 15:39:27",
"gmtUpdated": "2015-10-19 15:39:27",
"labelId": ***,
"labelName": "test"
}
},
"message": "请求成功",
"result": true
}
Delete
URL
https://api.sendcloud.net/apiv2/label/delete
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
labelId | int | * | label ID to be deleted |
startDate | string | * | start date, yyyy-MM-dd |
endDate | string | * | end date, yyyy-MM-dd |
TIPS:
- LabelId or the combination of startDate and endDate cannot both be empty, labelId takes priority.
Request Example
https://api.sendcloud.net/apiv2/label/delete?apiUser=***&apiKey=***&labelId=89
Returned Value Description
parameter | description |
---|---|
count | amount of deleted labels |
Returned Value Example
{
"statusCode": 200,
"info": {
"count": 1
},
"message": "请求成功",
"result": true
}
Modify
URL
https://api.sendcloud.net/apiv2/label/update
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
labelId | int | yes | label ID to be modified |
labelName | string | yes | new label name |
Request Example
https://api.sendcloud.net/apiv2/label/update?apiUser=***&apiKey=***&labelId=89&labelName=testnew
Returned Value Description
parameter | description |
---|---|
count | count of modified labels |
Returned Value Example
{
"statusCode": 200,
"info": {
"count": 1
},
"message": "请求成功",
"result": true
}
----
{
"statusCode": 40111,
"info": {},
"message": "标签名称已经存在",
"result": false
}