Member_fields
อัพเดทล่าสุด :2022-12-28
Create
URL
https://email.api.engagelab.cc/v1/marketing/lists/fields
https://email.api.engagelab.cc/v1/marketing/lists/fields
โค้ดนี้โชว์เป็นหน้าต่างลอย
HTTP request method
POST
POST
โค้ดนี้โชว์เป็นหน้าต่างลอย
Content-Type
application/json; charset=utf-8
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 |
---|---|---|---|
field_name | string | true | Field name (maximum 64 characters, consisting of only a-z, A-Z, 0-9, _ and cannot be a system-defined field string; including system fields Email, Name, Phone, a total of 50 fields can be created) |
field_type | integer | true | Field type (0: text, 1: number, 2: date, 3: birthday, 4: dropdown) |
visible | boolean | true | Whether it is visible, true or false |
format | string | false | Data format: 0 or .0 or .00 (when field_type=1); MM/DD/YYYY or DD/MM/YYYY (when field_type=2); MM/DD or DD/MM (when field_type=3) |
options | string[] | false | List of items for dropdown type, cannot be empty when field_type is dropdown, maximum of 10 data items |
Note:
- System fields: Email, Name, Phone, Tag, Campaign, Segment, Domain, CreateTime, UpdateTime, UnsubscribeTime.
- Field names cannot be system fields, and changing the letter case is also not allowed for creating them.
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/fields --data '{
"field_name": "xiao",
"field_type": 3,
"visible": true,
"format": "MM/DD"
}'
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields --data '{
"field_name": "xiao",
"field_type": 3,
"visible": true,
"format": "MM/DD"
}'
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response-Success
HttpStatus: 200
{
"result": {
"field_id": 11,
"field_name": "xiao",
"field_type": 3,
"visible": true,
"format": "MM/DD"
}
}
{
"result": {
"field_id": 11,
"field_name": "xiao",
"field_type": 3,
"visible": true,
"format": "MM/DD"
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response-Error
HTTP Status :401
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Delete
URL
https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}
https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}
โค้ดนี้โชว์เป็นหน้าต่างลอย
HTTP request method
DELETE
DELETE
โค้ดนี้โชว์เป็นหน้าต่างลอย
Content-Type
application/x-www-form-urlencoded;charset=utf-8
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/fields/569
curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields/569
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response example
Response-Success
HttpStatus: 200
{
"count": 1
}
{
"count": 1
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response-Error
{
"code": 30037,
"message": "delete failure"
}
{
"code": 30037,
"message": "delete failure"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Update
URL
https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}
https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}
โค้ดนี้โชว์เป็นหน้าต่างลอย
HTTP request method
PUT
PUT
โค้ดนี้โชว์เป็นหน้าต่างลอย
Content-Type
application/json; charset=utf-8
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 |
---|---|---|---|
field_name | string | true | Field name (maximum 64 characters, consisting only of a-z, A-Z, 0-9, _, and cannot be a system-defined field string (ignoring case); a total of 50 fields can be created, including system fields Email, Name, Phone) |
field_type | integer | true | Field type (0: text, 1: number, 2: date, 3: birthday, 4: dropdown) |
visible | boolean | true | Whether it is visible, true or false |
format | string | false | Data format: 0 or .0 or .00 (fieldType=1); MM/DD/YYYY or DD/MM/YYYY (fieldType=2); MM/DD or DD/MM (fieldType=3) |
options | string[] | false | Contents of dropdown list items for dropdown type; must not be empty when field_type is dropdown, and can have a maximum of 10 data entries. |
Note:
- System fields:Email、Name、Phone、tag、campaign、segment、domain、createTime、updateTime、unsubscribeTime
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/fields/839 --data '{
"field_name": "xiao",
"field_type": 3,
"visible": true,
"format": "MM/DD"
}'
curl -X PUT -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields/839 --data '{
"field_name": "xiao",
"field_type": 3,
"visible": true,
"format": "MM/DD"
}'
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response example
Response-Success
HttpStatus: 200
{
"count": 1
}
{
"count": 1
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response-Error
{
"code": 30036,
"message": "not found"
}
{
"code": 30036,
"message": "not found"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Field list
URL
https://email.api.engagelab.cc/v1/marketing/lists/fields
https://email.api.engagelab.cc/v1/marketing/lists/fields
โค้ดนี้โชว์เป็นหน้าต่างลอย
HTTP request method
GET
GET
โค้ดนี้โชว์เป็นหน้าต่างลอย
Content-Type
application/x-www-form-urlencoded;charset=utf-8
application/x-www-form-urlencoded;charset=utf-8
โค้ดนี้โชว์เป็นหน้าต่างลอย
Request-Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | true | Basic base64(api_user:api_key) |
Query-Parameters
Parameter | Type | Required | Description |
---|---|---|---|
field_name | string | false | Field name, fuzzy query |
Request-Example
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields?field_name=Age
curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields?field_name=Age
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response-Parameters
Parameter | Type | Description |
---|---|---|
result | array[object] | Field List |
field_name | string | Field name (up to 64 characters, composed only of a-z, A-Z, 0-9, _, and cannot be a system-defined field string (case-insensitive); a total of 50 fields can be created, including system fields such as Email, Name, Phone) |
field_type | integer | Field type (0: text, 1: number, 2: date, 3: birthday, 4: dropdown) |
visible | boolean | Visibility (true or false) |
format | string | Data format: 0 or .0 or .00 (fieldType=1); MM/DD/YYYY or DD/MM/YYYY (field_type=2); MM/DD or DD/MM (field_type=3) |
options | string[] | Dropdown list content for dropdown type, should not be empty when field_type is dropdown, maximum of 10 data entries |
field_id | integer | Index corresponding to the field, -1 indicates a system field |
total | integer | Total number of records matching the query |
count | integer | Number of records matching the query in this query result |
Response example
Response-Success
HttpStatus: 200
{
"result": [
{
"field_name": "Email",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": -1
},
{
"field_name": "Name",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": -1
},
{
"field_name": "Phone",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": -1
},
{
"field_name": "Gender",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": 0
},
{
"field_name": "Birthday",
"field_type": 3,
"visible": true,
"format": "MM/DD",
"options": null,
"field_id": 1
},
{
"field_name": "Age",
"field_type": 1,
"visible": true,
"format": "0",
"options": null,
"field_id": 2
},
{
"field_name": "remark",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": 3
}
],
"total": 7,
"count": 7
}
{
"result": [
{
"field_name": "Email",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": -1
},
{
"field_name": "Name",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": -1
},
{
"field_name": "Phone",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": -1
},
{
"field_name": "Gender",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": 0
},
{
"field_name": "Birthday",
"field_type": 3,
"visible": true,
"format": "MM/DD",
"options": null,
"field_id": 1
},
{
"field_name": "Age",
"field_type": 1,
"visible": true,
"format": "0",
"options": null,
"field_id": 2
},
{
"field_name": "remark",
"field_type": 0,
"visible": true,
"format": null,
"options": null,
"field_id": 3
}
],
"total": 7,
"count": 7
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
Response-Error
HTTP Status :401
{
"code": 30000,
"message": "Authentication failed"
}
{
"code": 30000,
"message": "Authentication failed"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย