标签管理
创建标签
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags
HTTP 请求方式
POST
Content-Type
application/json; charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Body 参数
Parameter | Type | Required | Description |
---|---|---|---|
name | string | true | 标签名称, 最长64个字符,仅由 a-z,A-z,0-9,_, 中文汉字等组成 |
请求示例
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags --data '{
"name": "myCustomTag"
}'
响应示例
Response-Success
HttpStatus:200
{
"result":{
"tag_id": "62732d3ddd017d22ccd118e4",
"tag_name": "教育",
"create_time": "2023-11-28T11:14:48+0800",
"update_time": "2023-11-28T11:14:48+0800",
}
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
删除标签
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}
HTTP 请求方式
DELETE
Content-Type
application/x-www-form-urlencoded;charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
请求示例
curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags/61c2be010d2b4e6a3836ab1f
响应示例
Response-Success
HttpStatus: 200
{
"count": 1
}
Response-Error
{
"code": 30036,
"message": "resource not found"
}
更新标签
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}
HTTP 请求方式
PUT
Content-Type
application/json; charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Body 参数
Parameter | Type | Required | Description |
---|---|---|---|
name | string | false | 标签名称,最长64个字符,仅由 a-z,A-z,0-9,_, 中文汉字等组成 |
请求示例
curl -X PUT -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/tags/617a71ac672b2823a1a82c13 61c2be010d2b4e6a3836ab1f --data '{
"name": "myCustomTag"
}'
响应示例
Response-Success
HttpStatus: 200
{
"count": 1
}
Response-Error
HttpStatus: 400
{
"code": 30035,
"message": "Tag name only consists of a-z, A-z, 0-9, _,chinese character, up to 64 characters"
}
标签列表
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags
HTTP 请求方式
GET
Content-Type
application/x-www-form-urlencoded;charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Query 参数
Parameter | Type | Required | Description |
---|---|---|---|
name | string | false | 查询的标签名(支持模糊查询) |
offset | integer | false | 查询起始位置, 取值区间 [0-], 默认为 0 |
limit | integer | false | 查询个数, 取值区间 [1-100], 默认为 10 |
请求示例
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags?offset=0&limit=10&name=教育
响应说明
Parameters | Type | Description |
---|---|---|
result | array[object] | 联系人列表 |
tag_id | string | 标签 ID |
name | string | 标签名称 |
create_time | string | 创建时间 |
update_time | string | 更新时间 |
count | integer | 含有此标签的联系人个数 |
total | integer | 本次查询符合条件的记录总数 |
count | integer | 返回记录总数 |
响应示例
Response-Success
HttpStatus: 200
{
"result": [
{
"tag_id": "617a71ac672b2823a1a82c13",
"tag_name": "教育",
"create_time": "2023-11-28T11:14:48+0800",
"update_time":"2023-11-28T11:14:48+0800",
"count": 1,
}
],
"count": 1,
"total": 1
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
联系人添加标签
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/add
HTTP 请求方式
POST
Content-Type
application/json; charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Body 参数
Parameter | Type | Required | Description |
---|---|---|---|
member_ids | string[] | true | 联系人 ID 列表,单次最大1000个联系人 ID |
请求示例
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags/61c2be010d2b4e6a3836ab1f/add --data '{
"member_ids": [
"61c2be010d2b4e6a3836ab1f",
"61c2be010d2b4e6a3836ab1d"
]
}'
响应示例
Response-Success
HttpStatus: 200
{
"count": 2
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
联系人移除标签
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/remove
HTTP 请求方式
POST
Content-Type
application/json; charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
Body 参数
Parameter | Type | Required | Description |
---|---|---|---|
member_ids | array[string] | true | 联系人 ID 列表,单次最大1000个联系人 ID |
请求示例
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags/ 616683a13a7b531b0336108d/remove --data '{
"memberIds": [
"61c2be010d2b4e6a3836ab1f",
"61c2be010d2b4e6a3836ab1d"
]
}'
响应示例
Response-Success
HttpStatus:200
{
"count": 1
}
HttpStatus: 401
Response-Error
{
"code": 30000,
"message": "Authentication failed"
}
获取联系人
URL
https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/members
HTTP 请求方式
GET
Content-Type
application/x-www-form-urlencoded;charset=utf-8
请求 Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Bearer Token |
查询说明
Parameter | Type | Required | Description |
---|---|---|---|
offset | integer | false | 查询起始位置,取值区间 [0-], 默认为 0 |
limit | integer | false | 查询个数,取值区间 [1-100], 默认为 10 |
请求示例
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags/616683a13a7b531b0336108d/members?offset=0&limit= 10
响应说明
parameters | Type | Description |
---|---|---|
result | object | 联系人列表 |
member_id | string | 联系人 ID |
list_id | integer | 列表 ID |
string | 邮箱地址 | |
phone | string | 手机号码 |
name | string | 名字 |
create_time | string | 创建时间(UTC+8) |
update_time | string | 更新时间(UTC+8) |
unsubscribe_time | string | 取消订阅时间(UTC+8) |
fields | object | 联系人属性 |
tag_ids | array[string] | 标签ID 集合 |
tag_names | array[string] | 标签名集合 |
total | integer | 本次查询符合条件的记录总数 |
响应示例
Response-Success
HttpStatus: 200
{
"result": [
{
"member_id": "6565c12a3b4e0d83d3f58ea0",
"list_id": 95964,
"email": "xjmfc@126.com",
"phone": null,
"name": null,
"fields": {
"Birthday": "03/30",
"Age": "12"
},
"tag_ids": [
"646f28a7cac6587565ad6918"
],
"tag_names": [
"test"
],
"create_time": "2023-11-28T18:30:02+0800",
"update_time": "2023-11-30T16:42:11+0800",
"unsubscribe_time": null
}
],
"total": 2,
"count": 1
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}