สร้างผู้ติดต่อ
นักพัฒนาสามารถสร้างผู้ติดต่อผ่าน API ได้
วิธีการร้องขอ
POST
URL สำหรับการร้องขอ
https://livedesk-api.engagelab.com/api/v2/accounts/contacts
การยืนยันตัวตน
สำหรับรายละเอียด โปรดดูคำอธิบายวิธีการยืนยันตัวตนใน ภาพรวม API
คำขอ
ตัวอย่างคำขอ
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/contacts \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407,
"name": "Test", // ไม่บังคับ
"email": "alice@acme.inc",
"phone_number": "+123456789",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
}
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/contacts \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407,
"name": "Test", // ไม่บังคับ
"email": "alice@acme.inc",
"phone_number": "+123456789",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
พารามิเตอร์ส่วนหัวของคำขอ
| Field | Type | Description |
|---|---|---|
| Authorization | string | ใช้ Authorization: Basic base64(API Key:API Secret) สำหรับการยืนยันตัวตน โปรดไปที่หน้า API Key เพื่อรับ API Key และ API Secret จากนั้นเชื่อมทั้งสองค่าด้วยเครื่องหมายโคลอนแล้วเข้ารหัสด้วย Base64 |
| Content-Type | application/json | ประเภทข้อมูล สำหรับข้อความธรรมดาให้ใช้ application/json |
พารามิเตอร์ใน Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| inbox_id | String | Yes | ID ของช่องทาง สอดคล้องกับ Channel ID ใน "Project Settings - Channels - specific channel - Settings" |
| name | String | No | ชื่อผู้ติดต่อ |
| String | No | ที่อยู่อีเมล | |
| phone_number | String | No | หมายเลขติดต่อ |
| avatar_url | String | No | ลิงก์รูปโปรไฟล์ |
| identifier | String | No | ตัวระบุผู้ใช้ |
การตอบกลับ
ตัวอย่างการตอบกลับ
{
"payload": {
"contact": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219259,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571703,
"contact_inboxes": []
},
"contact_inbox": {
"inbox": null,
"source_id": null
}
}
}
{
"payload": {
"contact": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219259,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571703,
"contact_inboxes": []
},
"contact_inbox": {
"inbox": null,
"source_id": null
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
พารามิเตอร์การตอบกลับ
| Field | Type | Required | Description |
|---|---|---|---|
| additional_attributes | Object | No | คุณสมบัติเพิ่มเติม |
| availability_status | String | No | สถานะออนไลน์ ค่าเริ่มต้นคือ offline |
| String | No | ที่อยู่อีเมล | |
| id | String | No | ID ผู้ติดต่อ |
| name | String | No | ชื่อ |
| phone_number | String | No | หมายเลขโทรศัพท์ |
| blocked | String | No | ถูกบล็อกหรือไม่ ค่าเริ่มต้นคือ false |
| identifier | String | No | ตัวระบุผู้ใช้ |
| thumbnail | String | No | ภาพย่อ |
| custom_attributes | String | No | คุณสมบัติของลูกค้า |
| created_at | String | No | เวลาที่สร้าง |
| contact_inboxes | Array | No | ข้อมูลช่องทางที่เชื่อมโยง |
| inbox | String | No | ช่องทาง |
| source_id | String | No | ID ของแหล่งที่มา |










