Members
Batch add or update
URL
https://email.api.engagelab.cc/v1/marketing/lists/members
HTTP request method
POST
Content-Type
application/json; charset=utf-8
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Body-Parameters
Parameter | Type | Required | Description |
---|---|---|---|
members | array[object] | true | List of members, up to a maximum of 1000 |
string | true | Email address | |
phone | string | false | Phone number |
name | string | false | Nickname |
fields | object | false | Contact fields |
tags | string[] | false | List of tag names |
tag_flag | integer | false | Tag update method: 0 for overwrite, 1 for append, 2 for skip (default is 1) |
update_existing | boolean | true | Whether to update properties if the address already exists |
Note:
- If the Email field of a member is the same as the value of the parameter members.email, it means updating the member. Otherwise, it means adding a new member.
- Different values of tag_flag correspond to different ways of updating tags. Refer to the example below:
tag_flag | Original tags | parameter tags | new tags |
---|---|---|---|
0 | [1,2,3] | [] | [] |
0 | [1,2,3] | null,no value passed | [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,no value passed | [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,no value passed | [1,2,3] |
2 | [1,2,3] | [3,4,5] | [1,2,3] |
2 | [] | [3,4,5] | [] |
Request-Example
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":"Zhusuosuo","fields":{"Birthday":"03/30","Age":"12","customField":"My test"},"tags":["testTag"]}],"tag_flag":0,"update_existing":true}'
Response example
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": "..."
}]
}
Response-Error
{
"code": 30000,
"message": "Authentication failed"
}
Delete
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
HTTP request method
DELETE
Content-Type
application/x-www-form-urlencoded;charset=utf-8
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Request-Example
curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/8
Response example
Response-Success
HttpStatus: 200
{
"count": 1
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
Batch delete
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/delete
HTTP request method
DELETE
Content-Type
application/json; charset=utf-8
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Body-Parameters
Parameter | Type | Required | Description |
---|---|---|---|
condition | object | false | Query condition |
relation | string | true | Condition relation (and or or) |
items | object[] | true | Filtering conditions: Supports up to 10 filtering conditions. When all conditions have the same relation (either all "and" or all "or") |
field_name | string | true | field_name represents the attribute name, and value represents the field value. When field_name is tag, value = tag name |
op | string | true | Operator (==, !=, >, >=, <, <=, exist, contain, does not contain) |
value | string | true | When field_name is tag, value = tag name When field_name is an attribute name, please refer to Filter Conditions for the format. |
说明
- The relationship between field_name and op can be referred to as follows Filter Conditions
Request-Example
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 example
Response-Success
HttpStatus: 200
{
"count": 1
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
Update
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
HTTP request method
PUT
Content-Type
application/json; charset=utf-8
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Body-Parameters
Parameter | Type | Required | Description |
---|---|---|---|
phone | string | false | Phone number |
name | string | false | Nickname |
fields | object | false | member fields |
tags | string[] | false | Tag name list |
Request-Example
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":"My test"},"tags":["testTag"]}'
Response-Parameters
Parameter | Type | Description |
---|---|---|
member_id | string | Member ID |
list_id | integer | List ID |
user_id | integer | User ID |
string | Email Address | |
phone | string | Phone Number |
name | string | Name |
create_time | string | Create Time (UTC+8) |
update_time | string | Subscription Update Time (UTC+8) |
unsubscribe_time | string | Unsubscribe Time (UTC+8) |
fields | object | member Fields |
tags | string[] | Tag IDs Set |
tag_names | string[] | Tag Names Set |
Response example
Response-Success
HttpStatus: 200
{
"count": 1
}
Response-Error
HttpStatus: 200
{
"code": 30036,
"message": "resource not found"
}
Member details
URL
https://email.api.engagelab.cc/v1/marketing/lists/members/{member_id}
HTTP request method
GET
Content-Type
application/x-www-form-urlencoded;charset=utf-8
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Request-Example
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/members/62974a5e490f33c5eee647a2
Response-Parameters
Parameter | Type | Description |
---|---|---|
member_id | string | Member ID |
list_id | integer | List ID |
string | Email Address | |
phone | string | Phone Number |
name | string | Name |
create_time | string | Creation Time (UTC+8) |
update_time | string | Subscription Update Time (UTC+8) |
unsubscribe_time | string | Unsubscription Time (UTC+8) |
fields | object | Contact Properties |
tag_ids | string[] | Tag ID Set |
tag_names | string[] | Tag Name Set |
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
}
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}
Member list
URL
https://email.api.engagelab.cc/v1/marketing/lists/list_members
HTTP request method
POST
Content-Type
application/json; charset=utf-8
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Query-Parameters
Parameter | Type | Required | Description |
---|---|---|---|
limit | integer | false | Number of items to retrieve, range [1-100], default is 10 |
offset | integer | false | Starting position of the query, range [0-], default is 0 |
Body-Parameters
Parameter | Type | Required | Description |
---|---|---|---|
condition | object | false | Query condition |
relation | string | true | Condition relation (and or or) |
items | object[] | true | Filtering conditions. Supports up to 10 filtering conditions, where all conditions are either all "and" or all "or" according to the relation specified |
field_name | string | true | field_name represents the field name, and value represents the field value; When field_name is tag, value=tag name |
op | string | true | Operator (==, !=, >, >=, <, <=, exist, contain, does not contain) |
value | string | true | When field_name is tag, value=tag name When field_name is an field name, please refer to the format of the value filter-conditions |
Note:
- Please refer to the corresponding relationship between field_name and op filter-conditions
Request-Example
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"
}
]
}
}'
Response-Parameters
Parameter | Type | Description |
---|---|---|
list | array | List Array |
member_id | string | Member ID |
list_id | integer | List ID |
string | Email Address | |
phone | string | Phone Number |
name | string | Name |
create_time | string | Creation Time (UTC+8) |
update_time | string | Update Subscription Time (UTC+8) |
unsubscribe_time | string | Unsubscribe Time (UTC+8) |
fields | object | Member Properties |
tag_ids | string[] | Tag ID Set |
tag_names | string[] | Tag Name Set |
total | integer | Total Records |
Response example
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
}
Response-Error
HttpStatus: 401
{
"code": 30000,
"message": "Authentication failed"
}