อัปเดตผู้ติดต่อ

นักพัฒนาสามารถอัปเดตข้อมูลผู้ติดต่อผ่าน 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)' \ { "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)' \
{
    "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 Key เพื่อรับ API Key และ API Secret จากนั้นเชื่อมทั้งสองค่าด้วยเครื่องหมายโคลอนแล้วเข้ารหัสด้วย Base64
Content-Type application/json ประเภทข้อมูล สำหรับข้อความธรรมดาให้ใช้ application/json

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

Field Type Required Description
account integer Yes ID บัญชี
id integer Yes ID ผู้ติดต่อ

พารามิเตอร์ใน Request Body

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 String 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 Array 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": "ช่องทางบริการลูกค้า", "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": "ช่องทางบริการลูกค้า",
          "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 String No ถูกบล็อกหรือไม่ ค่าเริ่มต้นคือ false
identifier String No ตัวระบุภายนอกที่ไม่ซ้ำของผู้ติดต่อ ตรงกับ UserID ที่แสดงในอินเทอร์เฟซ
thumbnail String No URL รูปโปรไฟล์
custom_attributes String No คุณสมบัติของผู้ติดต่อ
created_at String No เวลาที่สร้าง
last_activity_at String No เวลาที่อัปเดตล่าสุด
contact_inboxes array ข้อมูลช่องทางที่เชื่อมโยง จะส่งกลับเฉพาะเมื่อ include_contact_inboxes=true
source_id String No ID ของแหล่งที่มา
inbox Object No ข้อมูลกล่องข้อความ
id Integer No ID กล่องข้อความ
name String No ชื่อกล่องข้อความ
channel_type String No ประเภทช่องทาง
Icon Solid Transparent White Qiyu
ติดต่อฝ่ายขาย