การจัดการ Attribute
สร้าง Attribute
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 | ชื่อฟิลด์ (สูงสุด 64 ตัวอักษร ประกอบด้วย a-z, A-Z, 0-9, _, และไม่สามารถเป็น string attribute ที่ระบบกำหนดไว้ (ไม่สนใจตัวพิมพ์เล็กใหญ่); รวมถึงฟิลด์ระบบ Email, Name, Phone, สามารถสร้างได้ทั้งหมด 50 ฟิลด์ attribute |
field_type | integer | true | ประเภทฟิลด์ (0: ข้อความ, 1: ตัวเลข, 2: วันที่, 3: วันเกิด, 4: เลือกจากรายการ) |
visible | boolean | true | มองเห็นได้ true หรือ false |
format | string | false | รูปแบบข้อมูล: 0 หรือ .0 หรือ .00 (เมื่อ field_type=1); MM/DD/YYYY หรือ DD/MM/YYYY (เมื่อ field_type=2); MM/DD หรือ DD/MM (เมื่อ field_type=3) |
options | string[] | false | รายการสำหรับประเภท dropdown ไม่สามารถว่างเปล่าเมื่อ field_type เป็น dropdown สูงสุด 10 รายการ |
หมายเหตุ:
- Attributes ของระบบ: Email, Name, Phone, tag, campaign, segment, domain, createTime, updateTime, unsubscribeTime
- field_name ไม่สามารถเป็น attribute ของระบบได้ การเปลี่ยนตัวพิมพ์ใหญ่เล็กของตัวอักษรก็ไม่อนุญาตให้สร้าง
Request Example
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"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
ลบ Attribute
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"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
อัปเดต Attribute
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 | ชื่อฟิลด์ (สูงสุด 64 ตัวอักษร ประกอบด้วย a-z, A-Z, 0-9, _, และไม่สามารถเป็น string attribute ที่ระบบกำหนดไว้ (ไม่สนใจตัวพิมพ์เล็กใหญ่)); รวมถึงฟิลด์ระบบ Email, Name, Phone, สามารถสร้างได้ทั้งหมด 50 ฟิลด์ attribute |
field_type | integer | true | ประเภทฟิลด์ (0: ข้อความ, 1: ตัวเลข, 2: วันที่, 3: วันเกิด, 4: เลือกจากรายการ) |
visible | boolean | true | มองเห็นได้ true หรือ false |
format | string | false | รูปแบบข้อมูล: 0 หรือ .0 หรือ .00 (เมื่อ fieldType=1); MM/DD/YYYY หรือ DD/MM/YYYY (เมื่อ fieldType=2); MM/DD หรือ DD/MM (เมื่อ fieldType=3) |
options | string[] | false | รายการสำหรับประเภท dropdown ไม่สามารถว่างเปล่าเมื่อ field_type เป็น dropdown สูงสุด 10 รายการ |
หมายเหตุ:
- Attributes ของระบบ: 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"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
รายการ Attribute
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 | ชื่อฟิลด์, การค้นหาแบบคลุมเครือ |
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 Description
Parameter | Type | Description |
---|---|---|
result | array[object] | รายการ Attribute |
field_name | string | ชื่อฟิลด์ (สูงสุด 64 ตัวอักษร ประกอบด้วย a-z, A-Z, 0-9, _, และไม่สามารถเป็น string attribute ที่ระบบกำหนดไว้ (ไม่สนใจตัวพิมพ์เล็กใหญ่); รวมถึงฟิลด์ระบบ Email, Name, Phone, สามารถสร้างได้ทั้งหมด 50 ฟิลด์ attribute |
field_type | integer | ประเภทฟิลด์ (0: ข้อความ, 1: ตัวเลข, 2: วันที่, 3: วันเกิด, 4: เลือกจากรายการ) |
visible | boolean | มองเห็นได้ true หรือ false |
format | string | รูปแบบข้อมูล: 0 หรือ .0 หรือ .00 (เมื่อ fieldType=1); MM/DD/YYYY หรือ DD/MM/YYYY (เมื่อ field_type=2); MM/DD หรือ DD/MM (เมื่อ field_type=3) |
options | string[] | รายการสำหรับประเภท dropdown ไม่สามารถว่างเปล่าเมื่อ field_type เป็น dropdown สูงสุด 10 รายการ |
field_id | integer | idx ที่สอดคล้องกับ attribute, -1 หมายถึง attribute ของระบบ |
total | integer | จำนวนรวมของเรคคอร์ดที่ตรงกับการค้นหา |
count | integer | จำนวนเรคคอร์ดที่ตรงกับการค้นหา |
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"
}
โค้ดนี้โชว์เป็นหน้าต่างลอย