# 邮件标签

标签为用户发送邮件提供了另一个维度的统计方式.

你可以使用 API 对标签进行查询, 添加, 删除, 修改操作


# 查询 ( 批量查询 )

返回标签的列表信息

URL

https://api2.sendcloud.net/api/label/list
1

HTTP请求方式

post    get
1

参数说明

参数 类型 必须 说明
apiUser string API_USER
apiKey string API_KEY
query string 模糊查询的关键词
start int 查询起始位置, 取值区间 [0-], 默认为 0
limit int 查询个数, 取值区间 [0-100], 默认为 100

请求示例

https://api2.sendcloud.net/api/label/list?apiUser=***&apiKey=***&query=edm&start=0&limit=200
1

返回值说明

参数 说明
labelId 标签ID
labelName 标签名称
gmtCreated 标签创建时间
gmtModified 标签修改时间

返回值示例

{
  "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": "request was successful",
  "result": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# 查询

URL

https://api2.sendcloud.net/api/label/get
1

HTTP请求方式

post    get
1

参数说明

参数 类型 必须 说明
apiUser string API_USER
apiKey string API_KEY
labelId int 标签ID

请求示例

https://api2.sendcloud.net/api/label/get?apiUser=***&apiKey=***&labelId=89
1

返回值说明

参数 说明
labelId 标签ID
labelName 标签名称
gmtCreated 标签创建时间
gmtModified 标签修改时间

返回值示例

{
  "info": {
    "data": {
      "gmtCreated": "2014-08-06 16:18:22",
      "gmtUpdated": "2014-08-06 16:18:22",
      "labelId": ***,
      "labelName": "***"
    }
  },
  "statusCode": 200,
  "message": "request was successful",
  "result": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13

# 添加

URL

https://api2.sendcloud.net/api/label/add
1

HTTP请求方式

post    get
1

参数说明

参数 类型 必须 说明
apiUser string API_USER
apiKey string API_KEY
labelName string 需要添加的标签名称

说明:

  1. label创建限制上限为10万个

请求示例

https://api2.sendcloud.net/api/label/add?apiUser=***&apiKey=***&labelName=test
1

返回值说明

参数 说明
labelId 标签ID
labelName 标签名称

返回值示例

{
  "statusCode": 200,
  "info": {
    "data": {
      "gmtCreated": "2015-10-19 15:39:27",
      "gmtUpdated": "2015-10-19 15:39:27",
      "labelId": ***,
      "labelName": "test"
    }
  },
  "message": "request was successful",
  "result": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13

# 删除

URL

https://api2.sendcloud.net/api/label/delete
1

HTTP请求方式

post    get
1

参数说明

参数 类型 必须 说明
apiUser string API_USER
apiKey string API_KEY
labelId int 需要删除的标签ID

请求示例

https://api2.sendcloud.net/api/label/delete?apiUser=***&apiKey=***&labelId=89
1

返回值说明

参数 说明
count 成功删除的个数

返回值示例

{
  "statusCode": 200,
  "info": {
    "count": 1
  },
  "message": "request was successful",
  "result": true
}
1
2
3
4
5
6
7
8

# 修改

URL

https://api2.sendcloud.net/api/label/update
1

HTTP请求方式

post    get
1

参数说明

参数 类型 必须 说明
apiUser string API_USER
apiKey string API_KEY
labelId int 需要修改的标签ID
labelName string 新的标签名称

请求示例

https://api2.sendcloud.net/api/label/update?apiUser=***&apiKey=***&labelId=89&labelName=testnew
1

返回值说明

参数 说明
count 修改成功的个数

返回值示例

{
  "statusCode": 200,
  "info": {
    "count": 1
  },
  "message": "request was successful",
  "result": true
}
----
{
  "statusCode": 40111,
  "info": {},
  "message": "标签名称已经存在",
  "result": false
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
上次更新: 2025/03/25 10:38:59