標籤管理

最新更新:2022-12-05

創建標籤

URL:

https://email.api.engagelab.cc/v1/marketing/lists/tags
          https://email.api.engagelab.cc/v1/marketing/lists/tags

        
此代碼塊在浮窗中顯示

HTTP 請求方式

POST
          POST

        
此代碼塊在浮窗中顯示

Content-Type

application/json; charset=utf-8
          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" }'
          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", } }
          {
    "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" }
          {
    "code": 30000,
    "message": "Authentication failed"
}

        
此代碼塊在浮窗中顯示

刪除標籤

URL

https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}
          https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}

        
此代碼塊在浮窗中顯示

HTTP 請求方式

DELETE
          DELETE

        
此代碼塊在浮窗中顯示

Content-Type

application/x-www-form-urlencoded;charset=utf-8
          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
          curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/tags/61c2be010d2b4e6a3836ab1f

        
此代碼塊在浮窗中顯示

響應示例

Response-Success

HttpStatus: 200

{ "count": 1 }
          {
   "count": 1
 }

        
此代碼塊在浮窗中顯示

Response-Error

{ "code": 30036, "message": "resource not found" }
          {
    "code": 30036,
    "message": "resource not found"
}

        
此代碼塊在浮窗中顯示

更新標籤

URL

https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}
          https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}

        
此代碼塊在浮窗中顯示

HTTP 請求方式

PUT
          PUT

        
此代碼塊在浮窗中顯示

Content-Type

application/json; charset=utf-8
          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" }'
          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 }
          {
   "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" }
          {
    "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
          https://email.api.engagelab.cc/v1/marketing/lists/tags

        
此代碼塊在浮窗中顯示

HTTP 請求方式

GET
          GET

        
此代碼塊在浮窗中顯示

Content-Type

application/x-www-form-urlencoded;charset=utf-8
          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=教育
          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 }
          {
  "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" }
          {
    "code": 30000,
    "message": "Authentication failed"
}

        
此代碼塊在浮窗中顯示

聯繫人添加標籤

URL

https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/add
          https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/add

        
此代碼塊在浮窗中顯示

*HTTP 請求方式

POST
          POST

        
此代碼塊在浮窗中顯示

Content-Type

application/json; charset=utf-8
          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" ] }'
          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 }
          {
 "count": 2
}

        
此代碼塊在浮窗中顯示

Response-Error

HttpStatus: 401

{ "code": 30000, "message": "Authentication failed" }
          {
    "code": 30000,
    "message": "Authentication failed"
}

        
此代碼塊在浮窗中顯示

聯繫人移除標籤

URL

https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/remove
          https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/remove

        
此代碼塊在浮窗中顯示

HTTP 請求方式

POST
          POST

        
此代碼塊在浮窗中顯示

Content-Type

application/json; charset=utf-8
          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" ] }'
          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 }
          {
    "count": 1
}

        
此代碼塊在浮窗中顯示

HttpStatus: 401

Response-Error

{ "code": 30000, "message": "Authentication failed" }
          {
    "code": 30000,
    "message": "Authentication failed"
}

        
此代碼塊在浮窗中顯示

獲取聯繫人

URL

https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/members
          https://email.api.engagelab.cc/v1/marketing/lists/tags/{tag_id}/members

        
此代碼塊在浮窗中顯示

HTTP 請求方式

GET
          GET

        
此代碼塊在浮窗中顯示

Content-Type

application/x-www-form-urlencoded;charset=utf-8
          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
          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
email 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 }
          {
    "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" }
          {
    "code": 30000,
    "message": "Authentication failed"
}

        
此代碼塊在浮窗中顯示
在文档中心打开
icon
Contact Sales