# 标签管理
# 创建标签
URL:
https://api2.sendcloud.net/marketing/lists/tags
Method: POST
Content-Type: application/json; charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Body-Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagName | string | true | 标签名称, 最长64个字符,仅由 a-z,A-z,0-9,_, 中文汉字等组成 |
Request-Example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags --data '{
"tagName": "myCustomTag"
}'
2
3
Response-Success:
HttpStatus: 201
Response:
{
"id": "62732d3ddd017d22ccd118e4"
}
2
3
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7
# 删除标签
URL:
https://api2.sendcloud.net/marketing/lists/tags/{tagId}
Method: DELETE
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Path-parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagId | string | true | 标签 ID |
Request-Example:
curl -X DELETE -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags/61c2be010d2b4e6a3836ab1f
Response-Success:
HttpStatus: 204
Response:
{}
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7
# 更新标签
URL:
https://api2.sendcloud.net/marketing/lists/tags/{tagId}
Method: PATCH
Content-Type: application/json; charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Path-parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagId | string | true | 需修改的标签 ID |
Body-Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagName | string | false | 标签名称,最长64个字符,仅由 a-z,A-z,0-9,_, 中文汉字等组成 |
Request-Example:
curl -X PATCH -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags/ 61c2be010d2b4e6a3836ab1f --data '{
"tagName": "myCustomTag"
}'
2
3
Response-Success:
HttpStatus: 200
Response:
{
"id": "62732d3ddd017d22ccd118e4",
"userId": 100249,
"tagName": "tag_update",
"createTime": "2022-05-05 09:49:49",
"updateTime": "2022-05-05 17:36:33",
"count": 0
}
2
3
4
5
6
7
8
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7
# 标签列表
URL:
https://api2.sendcloud.net/marketing/lists/tags
Method: GET
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Query-Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagName | string | false | 查询的标签名(支持模糊查询) |
offset | integer | false | 查询起始位置, 取值区间 [0-], 默认为 0 |
count | integer | false | 查询个数, 取值区间 [1-100], 默认为 10 |
Request-Example:
curl -X GET -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags?offset=0&count=10&tagName=教育
Response-Parameters:
Parameters | Type | Description |
---|---|---|
list | object[] | 联系人列表 |
└─id | string | 标签 ID |
└─userId | integer | 用户 ID |
└─tagName | string | 标签名称 |
└─createTime | string | 创建时间 |
└─updateTime | string | 更新时间 |
└─count | integer | 含有此标签的联系人个数 |
total | integer | 本次查询符合条件的记录总数 |
Response-Success:
HttpStatus: 200
Response:
{
"list": [
{
"id": "617a71ac672b2823a1a82c13",
"userId": 303,
"tagName": "教育",
"createTime": "2022-05-27 15:31:41",
"updateTime": "2022-05-27 15:31:41",
"count": 254
}
],
"total": 297
}
2
3
4
5
6
7
8
9
10
11
12
13
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7
# 添加标签
URL:
https://api2.sendcloud.net/marketing/lists/tags/{tagId}/add
Method: POST
Content-Type: application/json; charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Path-parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagId | string | true | 标签 ID |
Body-Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
memberIds | string[] | true | 联系人 ID 列表,单次最大1000个联系人 ID |
Request-Example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags/61c2be010d2b4e6a3836ab1f/add --data '{
"memberIds": [
"61c2be010d2b4e6a3836ab1f",
"61c2be010d2b4e6a3836ab1d"
]
}'
2
3
4
5
6
Response-Success:
HttpStatus: 200
Response:
{
"successCount": 2
}
2
3
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7
# 移除标签
URL:
https://api2.sendcloud.net/marketing/lists/tags/{tagId}/remove
Method: POST
Content-Type: application/json; charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Path-parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagId | string | true | 当前所在的TagId |
Body-Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
memberIds | string[] | true | 联系人 ID 列表,单次最大1000个联系人 ID |
Request-Example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags/ 616683a13a7b531b0336108d/remove --data '{
"memberIds": [
"61c2be010d2b4e6a3836ab1f",
"61c2be010d2b4e6a3836ab1d"
]
}'
2
3
4
5
6
Response-Success:
HttpStatus: 200
Response:
{
"successCount": 2
}
2
3
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7
# 获取联系人
URL:
https://api2.sendcloud.net/marketing/lists/tags/{tagId}/members
Method: GET
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Request-Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Path-parameters:
Parameter | Type | Required | Description |
---|---|---|---|
tagId | string | true | 标签 ID |
Query-Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
offset | integer | false | 查询起始位置,取值区间 [0-], 默认为 0 |
count | integer | false | 查询个数,取值区间 [1-100], 默认为 10 |
Request-Example:
curl -X GET -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags/616683a13a7b531b0336108d/members?offset= 0&count= 10
Response-Parameters:
parameters | Type | Description |
---|---|---|
list | object | 联系人列表 |
└─id | string | 联系人 ID |
└─listId | integer | 列表 ID |
└─userId | integer | 用户 ID |
string | 邮箱地址 | |
└─phone | string | 手机号码 |
└─name | string | 名字 |
└─createTime | string | 创建时间(UTC+8) |
└─updateTime | string | 更新时间(UTC+8) |
└─unsubscribeTime | string | 取消订阅时间(UTC+8) |
└─fields | object | 联系人属性 |
└─tags | string[] | 标签ID 集合 |
└─tagNames | string[] | 标签名集合 |
└─createTimeFmt | string | 创建时间(账户设置的时区) |
└─updateTimeFmt | string | 更新时间(账户设置的时区) |
└─unsubscribeTimeFmt | string | 取消订阅时间(账户设置的时区) |
total | integer | 本次查询符合条件的记录总数 |
Response-Success:
HttpStatus: 200
Response:
{
"list": [
{
"id": "149",
"listId": 996,
"userId": "userId",
"email": "xjmfc@126.com",
"phone": "138999999999",
"name": "吴起",
"createTime": "2022-06-01 16:13:03",
"updateTime": "2022-06-01 16:13:03",
"unsubscribeTime": "2022-06-01",
"fields": {
"mapKey": {}
},
"tags": [
"iya0zz"
],
"tagNames": [
"0nghts"
],
"createTimeFmt": "jnntba",
"updateTimeFmt": "gemzp2",
"unsubscribeTimeFmt": "0at3f2"
}
],
"total": 719
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Response-Error:
{
"status":401,
"error":{
"parameter":"",
"message":"Unauthorized"
}
}
2
3
4
5
6
7