標籤管理
創建標籤
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 |
Query 參數
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"
}