Logo Site EngageLab Mark Colored Transparent
เอกสาร

อัปเดตรายชื่อติดต่อ

นักพัฒนาสามารถอัปเดตข้อมูลรายชื่อติดต่อผ่าน API ได้

เมธอดคำขอ

PATCH

URL คำขอ

https://livedesk-api.engagelab.com/api/v2/accounts/contacts/:id

การยืนยันตัวตน

สำหรับรายละเอียด โปรดดูวิธีการยืนยันตัวตนใน ภาพรวม API

คำขอ

ตัวอย่างคำขอ

curl -X PATCH https://livedesk-api.engagelab.com/api/v2/accounts/contacts/:id \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic base64(api_key:api_secret)' \ -d '{ "additional_attributes": { "description": "", "company_name": "", "city": "", "telegram": "", "country": "", "country_code": "", "social_profiles": { "facebook": "", "github": "", "instagram": "", "linkedin": "", "twitter": "" } }, "availability_status": "offline", "email": "support@jiguang.cn", "name": "support", "phone_number": null, "blocked": false, "identifier": "2222", "thumbnail": "", "last_activity_at": 1765441908, "custom_attributes": { // ไม่บังคับ: รวมและอัปเดตฟิลด์ที่กำหนดเอง (การรวมแบบเพิ่มทีละส่วน) "vip_level": "platinum" }, "created_at": 1765441895, "first_name": "support", "last_name": "" }'
              
              curl -X PATCH https://livedesk-api.engagelab.com/api/v2/accounts/contacts/:id \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
-d '{
    "additional_attributes": {
        "description": "",
        "company_name": "",
        "city": "",
        "telegram": "",
        "country": "",
        "country_code": "",
        "social_profiles": {
            "facebook": "",
            "github": "",
            "instagram": "",
            "linkedin": "",
            "twitter": ""
        }
    },
    "availability_status": "offline",
    "email": "support@jiguang.cn",
    "name": "support",
    "phone_number": null,
    "blocked": false,
    "identifier": "2222",
    "thumbnail": "",
    "last_activity_at": 1765441908,
    "custom_attributes": {
        // ไม่บังคับ: รวมและอัปเดตฟิลด์ที่กำหนดเอง (การรวมแบบเพิ่มทีละส่วน)
        "vip_level": "platinum"
    },
    "created_at": 1765441895,
    "first_name": "support",
    "last_name": ""
}'

            
โค้ดนี้โชว์เป็นหน้าต่างลอย

ส่วนหัวคำขอ

Field Type Description
Authorization string ใช้ Authorization: Basic base64(API Key:API Secret) สำหรับการยืนยันตัวตน ไปที่หน้าคีย์ API เพื่อรับ API Key และ API Secret จากนั้นเชื่อมค่าทั้งสองด้วยเครื่องหมายโคลอนและเข้ารหัสด้วย Base64
Content-Type application/json ประเภทข้อมูล ใช้ application/json สำหรับข้อมูลข้อความทั่วไป

พารามิเตอร์พาธ

Field Type Required Description
account integer Yes ID โปรเจกต์ LiveDesk
id integer Yes ID รายชื่อติดต่อ

พารามิเตอร์ในเนื้อหาคำขอ

Field Type Required Description
additional_attributes Object No แอตทริบิวต์เพิ่มเติม
description Object No คำอธิบาย
company_name String No ชื่อบริษัท
city String No เมือง
telegram String No ข้อมูลติดต่อ Telegram
country String No ประเทศ
country_code String No รหัสประเทศ
social_profiles String No ข้อมูลติดต่อบนโซเชียลมีเดีย
availability_status String No สถานะความพร้อมใช้งาน ค่าเริ่มต้นคือ offline
email String No ที่อยู่อีเมล
name String No ชื่อ
phone_number String No หมายเลขโทรศัพท์
blocked Boolean No ระบุว่ารายชื่อติดต่อนี้ถูกบล็อกหรือไม่ ค่าเริ่มต้นคือ false
identifier String No ตัวระบุภายนอกที่ไม่ซ้ำกันของรายชื่อติดต่อ ซึ่งสอดคล้องกับ UserID ที่แสดงในอินเทอร์เฟซ
thumbnail String No URL ของรูปโปรไฟล์รายชื่อติดต่อ
last_activity_at String No การประทับเวลาของการอัปเดตล่าสุด
created_at String No การประทับเวลาที่สร้าง
first_name String No ชื่อ
last_name String No นามสกุล
custom_attributes Object No ฟิลด์ที่กำหนดเอง

ตัวอย่างการตอบกลับ

{ "payload": { "additional_attributes": { "description": "", "company_name": "", "city": "", "telegram": "", "country": "", "country_code": "", "social_profiles": { "facebook": "", "github": "", "instagram": "", "linkedin": "", "twitter": "" } }, "availability_status": "offline", "email": "support@jiguang.cn", "id": 318763, "name": "support", "phone_number": null, "blocked": false, "identifier": "2222", "thumbnail": "", "custom_attributes": {}, "last_activity_at": 1765441908, "created_at": 1765441895, "contact_inboxes": [ { "source_id": "src_001", "inbox": { "id": 10, "name": "Customer Service Channel", "channel_type": "Channel::Api" } } ] } }
              
              {
    "payload": {
        "additional_attributes": {
            "description": "",
            "company_name": "",
            "city": "",
            "telegram": "",
            "country": "",
            "country_code": "",
            "social_profiles": {
                "facebook": "",
                "github": "",
                "instagram": "",
                "linkedin": "",
                "twitter": ""
            }
        },
        "availability_status": "offline",
        "email": "support@jiguang.cn",
        "id": 318763,
        "name": "support",
        "phone_number": null,
        "blocked": false,
        "identifier": "2222",
        "thumbnail": "",
        "custom_attributes": {},
        "last_activity_at": 1765441908,
        "created_at": 1765441895,
        "contact_inboxes": [
            {
                "source_id": "src_001",
                "inbox": {
                    "id": 10,
                    "name": "Customer Service Channel",
                    "channel_type": "Channel::Api"
                }
            }
        ]
    }
}

            
โค้ดนี้โชว์เป็นหน้าต่างลอย

พารามิเตอร์การตอบกลับ

Field Type Required Description
payload Object No โครงสร้างแอตทริบิวต์
additional_attributes Object No แอตทริบิวต์เพิ่มเติม
availability_status String No สถานะความพร้อมใช้งาน ค่าเริ่มต้นคือ offline
email String No ที่อยู่อีเมล
id String No ID รายชื่อติดต่อ
name String No ชื่อ
phone_number String No หมายเลขโทรศัพท์
blocked Boolean No ระบุว่ารายชื่อติดต่อนี้ถูกบล็อกหรือไม่ ค่าเริ่มต้นคือ false
identifier String No ตัวระบุภายนอกที่ไม่ซ้ำกันของรายชื่อติดต่อ ซึ่งสอดคล้องกับ UserID ที่แสดงในอินเทอร์เฟซ
thumbnail String No URL ของรูปโปรไฟล์
custom_attributes Object No แอตทริบิวต์ของรายชื่อติดต่อ
created_at String No การประทับเวลาที่สร้าง
last_activity_at String No การประทับเวลาของการอัปเดตล่าสุด
contact_inboxes Array No ข้อมูลช่องทางที่เชื่อมโยง โดยจะส่งกลับเมื่อ include_contact_inboxes=true เท่านั้น
source_id String No ID ช่องทาง
inbox Object No ข้อมูลช่องทาง
id String No ID ช่องทาง
name String No ชื่อช่องทาง
channel_type String No ประเภทช่องทาง
Icon Solid Transparent White Qiyu
ติดต่อฝ่ายขาย