ค้นหารายชื่อติดต่อ

นักพัฒนาสามารถใช้ API นี้เพื่อค้นหารายชื่อผู้ติดต่อภายใต้บัญชี โดยรองรับการค้นหาด้วยอีเมล phone_number ชื่อ และ identifier ของผู้ติดต่อ

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

GET

Endpoint

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

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

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

คำขอ

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

curl -X GET https://livedesk-api.engagelab.com/api/v2/accounts/contacts?q=support@engagelab.com \ -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?q=support@engagelab.com \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)'

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

Request Headers

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 Parameters

Field Type Required Description
q string No พารามิเตอร์สำหรับการค้นหา โดยฟิลด์ผู้ติดต่อที่รองรับ ได้แก่ email, phone_number, name และ identifier
page integer No หมายเลขหน้า ค่าเริ่มต้นคือ 1 โดยมี 15 รายการต่อหน้า
labels string / string[] No กรองตาม labels รองรับหลาย labels และใช้เงื่อนไขการจับคู่แบบตรงอย่างน้อยหนึ่งรายการ
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": { "source_id": "email:ed5c8362-425c-4589-8adb-61a033d8c5fb.support@engagelab.com" }, "availability_status": "offline", "email": "support@engagelab.com", "id": 64464046, "name": "support", "phone_number": null, "blocked": false, "identifier": null, "thumbnail": "", "custom_attributes": {}, "last_activity_at": 1778572024, "created_at": 1778570103, "contact_inboxes": [ { "source_id": "support@engagelab.com", "inbox": { "id": 985, "channel_id": 107, "name": "Email", "channel_type": "Channel::Email", "provider": null } } ] } ] }
              
              {
    "meta": {
        "count": 1,
        "current_page": 1
    },
    "payload": [
        {
            "additional_attributes": {
                "source_id": "email:ed5c8362-425c-4589-8adb-61a033d8c5fb.support@engagelab.com"
            },
            "availability_status": "offline",
            "email": "support@engagelab.com",
            "id": 64464046,
            "name": "support",
            "phone_number": null,
            "blocked": false,
            "identifier": null,
            "thumbnail": "",
            "custom_attributes": {},
            "last_activity_at": 1778572024,
            "created_at": 1778570103,
            "contact_inboxes": [
                {
                    "source_id": "support@engagelab.com",
                    "inbox": {
                        "id": 985,
                        "channel_id": 107,
                        "name": "Email",
                        "channel_type": "Channel::Email",
                        "provider": null
                    }
                }
            ]
        }
    ]
}

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

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

Field Type Required Description
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 ตัวระบุภายนอกที่ไม่ซ้ำกันของผู้ติดต่อ ซึ่งสอดคล้องกับ UserID ที่แสดงในอินเทอร์เฟซ
thumbnail String No URL รูปโปรไฟล์
custom_attributes String 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 ประเภทช่องทาง
provider String No ผู้ให้บริการ ตัวอย่างเช่น หากช่องทางเป็น WhatsApp ค่าที่สอดคล้องกันคือ whatsapp_cloud, engagelab_whatsapp หรือ twilio สำหรับช่องทางที่ไม่แยกผู้ให้บริการ ค่าจะเป็น null
Icon Solid Transparent White Qiyu
ติดต่อฝ่ายขาย