แสดงรายการผู้ติดต่อ

นักพัฒนาสามารถเรียกดูรายการผู้ติดต่อภายใต้บัญชีผ่าน API ได้

วิธีการร้องขอ

GET

URL สำหรับการร้องขอ

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

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

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

คำขอ

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

curl -X GET https://livedesk-api.engagelab.com/api/v2/accounts/contacts?include_contact_inboxes=false&page=1&sort=last_activity_at&page_size=10 \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic base64(api_key:api_secret)' \
              
              curl -X GET https://livedesk-api.engagelab.com/api/v2/accounts/contacts?include_contact_inboxes=false&page=1&sort=last_activity_at&page_size=10 \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \

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

พารามิเตอร์ส่วนหัวของคำขอ

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

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

Field Type Required Description
page integer No หมายเลขหน้า ค่าเริ่มต้นคือ 1 และแสดง 15 รายการต่อหน้า
labels string / string[] No กรองตามป้ายกำกับ รองรับหลายป้ายกำกับ และจะจับคู่เมื่อมีรายการใดรายการหนึ่งตรงกัน
include_contact_inboxes boolean No จะส่งกลับ contact_inboxes หรือไม่ ค่าเริ่มต้นคือ true
sort string No ฟิลด์สำหรับเรียงลำดับ ค่าที่รองรับคือ email, name, phone_number, last_activity_at, created_at, company, city, country
direction string No ทิศทางการเรียงลำดับ รองรับ asc หรือ desc

การตอบกลับเมื่อสำเร็จ

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

{ "meta": { "count": 1, "current_page": "1" }, "payload": [ { "additional_attributes": { "city": "", "country": "", "telegram": "", "description": "", "company_name": "", "country_code": "", "social_profiles": { "github": "", "twitter": "", "facebook": "", "linkedin": "", "instagram": "" } }, "availability_status": "offline", "email": "support@jiguang.cn", "id": 318763, "name": "support", "phone_number": null, "blocked": false, "identifier": "4444", "thumbnail": "", "custom_attributes": {}, "last_activity_at": 1765441908, "created_at": 1765441895, "contact_inboxes": [ // จะส่งกลับเมื่อ include_contact_inboxes=true { "source_id": "src_001", "inbox": { "id": 10, "name": "ช่องทางบริการลูกค้า", "channel_type": "Channel::Api" } } ] } ] }
              
              {
    "meta": {
        "count": 1,
        "current_page": "1"
    },
    "payload": [
        {
            "additional_attributes": {
                "city": "",
                "country": "",
                "telegram": "",
                "description": "",
                "company_name": "",
                "country_code": "",
                "social_profiles": {
                    "github": "",
                    "twitter": "",
                    "facebook": "",
                    "linkedin": "",
                    "instagram": ""
                }
            },
            "availability_status": "offline",
            "email": "support@jiguang.cn",
            "id": 318763,
            "name": "support",
            "phone_number": null,
            "blocked": false,
            "identifier": "4444",
            "thumbnail": "",
            "custom_attributes": {},
            "last_activity_at": 1765441908,
            "created_at": 1765441895,
            "contact_inboxes": [           // จะส่งกลับเมื่อ include_contact_inboxes=true
             {
              "source_id": "src_001",
              "inbox": 
              {
               "id": 10,
              "name": "ช่องทางบริการลูกค้า",
              "channel_type": "Channel::Api"
              }
             }
          ]
        }
    ]
}

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

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

Field Type Required Description
meta Object No อ็อบเจ็กต์เมทาดาทา
count Int No จำนวนผลลัพธ์จากการค้นหา
current_page Int No หมายเลขหน้าปัจจุบันของผลลัพธ์
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 ตัวระบุผู้ใช้
thumbnail String No ภาพย่อ
custom_attributes Object No คุณสมบัติของลูกค้า
created_at String No เวลาที่สร้าง
last_activity_at String No เวลากิจกรรมล่าสุด
created_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 ประเภทช่องทาง

การตอบกลับข้อผิดพลาด

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

HTTP Status Code Description
401 ไม่มีสิทธิ์เข้าถึง Token ไม่ถูกต้องหรือไม่ได้ส่งมา
403 สิทธิ์ไม่เพียงพอ
Icon Solid Transparent White Qiyu
ติดต่อฝ่ายขาย