联系人管理
最新更新:2022-12-05
批量添加或更新联系人
URL
https://email.api.engagelab.cc/v1/marketing/lists/members
https://email.api.engagelab.cc/v1/marketing/lists/members
此代码块在浮窗中显示
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 |
---|---|---|---|
members | array[object] | true | 联系人列表,上限个数1000 |
string | true | 邮箱地址 | |
phone | string | false | 电话号码 |
name | string | false | 昵称 |
fields | object | false | 联系人属性 |
tags | string[] | false | 标签名称列表 |
tag_flag | integer | false | 标签更新方式,0.覆盖、1.追加、2.跳过,默认值为1 |
update_existing | boolean | true | 是否更新属性(如果地址列表存在该地址) |
说明
- 如果某联系人 Email 字段和参数 members.email 的值相同,则为更新此联系人,反之为添加联系人。
- 关于 tag_flag 不同值,所对应的不同的标签更新方式,见下面示例:
tag_flag | 原tags | 参数tags | 新tags |
---|---|---|---|
0 | [1,2,3] | [] | [] |
0 | [1,2,3] | null,未传 | [1,2,3] |
0 | [1,2,3] | [3,4,5] | [3,4,5] |
1 | [1,2,3] | [] | [1,2,3] |
1 | [1,2,3] | null,未传 | [1,2,3] |
1 | [1,2,3] | [3,4,5] | [1,2,3,4,5] |
2 | [1,2,3] | [] | [1,2,3] |
2 | [1,2,3] | null,未传 | [1,2,3] |
2 | [1,2,3] | [3,4,5] | [1,2,3] |
2 | [] | [3,4,5] | [] |
请求示例
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
-i https://email.api.engagelab.cc/v1/marketing/lists/members
--data '{"members":[{"email":"xjmfc@126.com","phone":"13681312919","name":"朱锁锁","fields":{"Birthday":"03/30","Age":"12","customField":"我的测试"},"tags":["testTag"]}],"tag_flag":0,"update_existing":true}'
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ=='
-i https://email.api.engagelab.cc/v1/marketing/lists/members
--data '{"members":[{"email":"xjmfc@126.com","phone":"13681312919","name":"朱锁锁","fields":{"Birthday":"03/30","Age":"12","customField":"我的测试"},"tags":["testTag"]}],"tag_flag":0,"update_existing":true}'
此代码块在浮窗中显示
响应示例
Response-Success
HttpStatus: 200
{
"created_count": 2,
"created_members": [{
"email": "202205ab233444444444446@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b0c"
},{
"email": "202205ab3331@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b0d"
}],
"updated_count": 2,
"updated_members": [{
"email": "202205ab233444444444447@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b1c"
},{
"email": "202205ab3332@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b1d"
}],
"error_count": 2,
"error_members": [{
"email": "202205ab233444444444446@qq.com",
"message": "..."
},{
"email": "202205ab3331@qq.com",
"message": "..."
}]
}
{
"created_count": 2,
"created_members": [{
"email": "202205ab233444444444446@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b0c"
},{
"email": "202205ab3331@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b0d"
}],
"updated_count": 2,
"updated_members": [{
"email": "202205ab233444444444447@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b1c"
},{
"email": "202205ab3332@qq.com",
"member_id": "6294b0fa490f33c5ee3b5b1d"
}],
"error_count": 2,
"error_members": [{
"email": "202205ab233444444444446@qq.com",
"message": "..."
},{
"email": "202205ab3331@qq.com",
"message": "..."
}]
}
此代码块在浮窗中显示
Response-Error
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
此代码块在浮窗中显示
删除单个联系人
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_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/members/8
curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/8
此代码块在浮窗中显示
响应示例
Response-Success
HttpStatus: 200
{
"count": 1
}
{
"count": 1
}
此代码块在浮窗中显示
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
此代码块在浮窗中显示
批量删除联系人
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/delete
https://email.api.engagelab.cc/v1/marketing/lists/members/delete
此代码块在浮窗中显示
HTTP 请求方式
DELETE
DELETE
此代码块在浮窗中显示
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 |
---|---|---|---|
condition | object | false | 查询条件 |
relation | string | true | 条件关系 (and 或 or) |
items | object[] | true | 筛选条件:支持最多10个筛选条件,筛选条件之间,仅支持 relation 全为且,或全为或 |
field_name | string | true | field_name为属性名,value 为属性值; field_name为 tag 时,value = tag name |
op | string | true | 操作符 (== , != , > , >= , < , <= , exist , contain , does not contain) |
value | string | true | 当field_name为 tag 时,value = tag name 当field_name 为属性名,格式请参考筛选条件 |
说明
- field_name 和op 对应的关系请参考筛选条件
请求示例
curl -X DELETE -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/delete --data '
{
"condition": {
"relation": "or",
"items": [
{
"field_name": "Email",
"op": "contain",
"value": "hotmail.com"
},
{
"field_name": "Phone",
"op": "contain",
"value": "188"
}
]
}
}
'
curl -X DELETE -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/delete --data '
{
"condition": {
"relation": "or",
"items": [
{
"field_name": "Email",
"op": "contain",
"value": "hotmail.com"
},
{
"field_name": "Phone",
"op": "contain",
"value": "188"
}
]
}
}
'
此代码块在浮窗中显示
响应示例
Response-Success
HttpStatus: 200
{
"count": 1
}
{
"count": 1
}
此代码块在浮窗中显示
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
此代码块在浮窗中显示
更新单个联系人
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_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 |
---|---|---|---|
phone | string | false | 手机号 |
name | string | false | 昵称 |
fields | object | false | 联系人属性 |
tags | string[] | false | 标签名称列表 |
请求示例
curl -X PUT -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i
https://email.api.engagelab.cc/v1/marketing/lists/members/62974a5e490f33c5eee647a2
--data '{"phone":"13681312919","name":"朱锁锁","fields":{"Birthday":"03/30","Age":"12","customField":"我的测试"},"tags":["testTag"]}'
curl -X PUT -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i
https://email.api.engagelab.cc/v1/marketing/lists/members/62974a5e490f33c5eee647a2
--data '{"phone":"13681312919","name":"朱锁锁","fields":{"Birthday":"03/30","Age":"12","customField":"我的测试"},"tags":["testTag"]}'
此代码块在浮窗中显示
响应说明
Parameter | Type | Description |
---|---|---|
member_id | string | 联系人 ID |
list_id | integer | 列表 ID |
user_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 | 联系人属性 |
tags | string[] | 标签 ID 集合 |
tag_names | string[] | 标签名集合 |
响应示例
Response-Success
HttpStatus: 200
{
"count": 1
}
{
"count": 1
}
此代码块在浮窗中显示
Response-Error
HttpStatus: 200
{
"code": 30036,
"message": "resource not found"
}
{
"code": 30036,
"message": "resource not found"
}
此代码块在浮窗中显示
联系人详情
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
此代码块在浮窗中显示
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) |
请求示例
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/62974a5e490f33c5eee647a2
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/62974a5e490f33c5eee647a2
此代码块在浮窗中显示
响应说明
Parameter | Type | Description |
---|---|---|
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 | string[] | 标签 ID 集合 |
tag_names | string[] | 标签名集合 |
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": [],
"tag_names": [],
"create_time": "2023-11-28T18:30:02+0800",
"update_time": "2023-11-30T16:44:44+0800",
"unsubscribe_time": null
}
}
{
"result": {
"member_id": "6565c12a3b4e0d83d3f58ea0",
"list_id": 95964,
"email": "xjmfc@126.com",
"phone": null,
"name": null,
"fields": {
"Birthday": "03/30",
"Age": "12"
},
"tag_ids": [],
"tag_names": [],
"create_time": "2023-11-28T18:30:02+0800",
"update_time": "2023-11-30T16:44:44+0800",
"unsubscribe_time": null
}
}
此代码块在浮窗中显示
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
此代码块在浮窗中显示
联系人列表
URL
https://email.api.engagelab.cc/v1/marketing/lists/list_members
https://email.api.engagelab.cc/v1/marketing/lists/list_members
此代码块在浮窗中显示
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) |
Query 参数
Parameter | Type | Required | Description |
---|---|---|---|
limit | integer | false | 查询个数,取值区间 [1-100],默认为 10 |
offset | integer | false | 查询起始位置, 取值区间 [0-],默认为 0 |
Body 参数
Parameter | Type | Required | Description |
---|---|---|---|
condition | object | false | 查询条件 |
relation | string | true | 条件关系 (and 或 or) |
items | object[] | true | 筛选条件. 支持最多10个筛选条件,筛选条件之间,仅支持 relation 全部为且,或全部为或 |
field_name | string | true | field_name为属性名,value为属性值; field_name为 tag 时,value=tag name |
op | string | true | 操作符 (== , != , > , >= , < , <= , exist , contain , does not contain) |
value | string | true | 当field_name为 tag 时,value=tag name 当field_name 为属性名,格式请参考筛选条件 |
说明
- field_name 和op 对应的关系请参考筛选条件
请求示例
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/listMembers?offset=0&limit=10 --data '{
"condition": {
"relation": "and",
"items": [
{
"field_name": "Email",
"op": "contain",
"value": "qq.com"
}
]
}
}'
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/listMembers?offset=0&limit=10 --data '{
"condition": {
"relation": "and",
"items": [
{
"field_name": "Email",
"op": "contain",
"value": "qq.com"
}
]
}
}'
此代码块在浮窗中显示
响应说明
Parameter | Type | Description |
---|---|---|
list | array | 列表数组 |
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 | string[] | 标签ID 集合 |
tag_names | 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": [],
"tag_names": [],
"create_time": "2023-11-28T18:30:02+0800",
"update_time": "2023-11-30T17:00:19+0800",
"unsubscribe_time": null
}
],
"total": 3,
"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": [],
"tag_names": [],
"create_time": "2023-11-28T18:30:02+0800",
"update_time": "2023-11-30T17:00:19+0800",
"unsubscribe_time": null
}
],
"total": 3,
"count": 1
}
此代码块在浮窗中显示
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
此代码块在浮窗中显示