Logo Site EngageLab Mark Colored Transparent文件
搜尋

搜尋聯絡人

開發者可以透過 API 查詢帳號下的聯絡人列表,支援依聯絡人的 email、phone_number、name、identifier 進行搜尋。

請求方式

GET

呼叫位址

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)' \

            
此代碼塊在浮窗中顯示

請求標頭

字段 類型 描述
Authorization string 使用 Authorization: Basic base64(API Key:API Secret) 進行身分驗證。請前往 API 金鑰頁面取得 API Key 和 API Secret,並將兩者以冒號連接後進行 Base64 編碼。
Content-Type application/json 資料類型,一般文字訊息使用 application/json。

Query 參數

字段 類型 必填 描述
q string 查詢參數,聯絡人屬性欄位包括 email/phone_number/name/identifier
page integer 頁碼,預設為 1,每頁 15 筆
labels string / string[] 依標籤篩選,支援多個標籤(任一匹配)
include_contact_inboxes boolean 是否回傳 contact_inboxes,預設為 true
sort string 排序欄位,可選值:emailnamephone_numberlast_activity_atcreated_atcompanycitycountry
direction string 排序方向,ascdesc

回應範例

{ "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": "邮箱", "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": "邮箱",
                        "channel_type": "Channel::Email",
                        "provider": null
                    }
                }
            ]
        }
    ]
}

            
此代碼塊在浮窗中顯示

回應參數

字段 類型 必填 描述
count Int 查詢結果數量。
current_page Int 查詢結果頁碼。
payload Object 屬性結構。
additional_attributes Object 附加屬性。
availability_status String 線上狀態,預設為 offline。
email String 電子郵件地址。
id String 聯絡人 ID。
name String 名稱。
phone_number String 手機號碼。
blocked String 是否鎖定,預設為 false。
identifier String 聯絡人外部唯一識別,對應介面顯示的 UserID。
thumbnail String 頭像 URL。
custom_attributes String 聯絡人屬性。
created_at String 建立時間戳。
last_activity_at String 最新更新時間戳。
contact_inboxes Array 關聯的渠道資訊,僅在 include_contact_inboxes=true 時回傳
source_id String 渠道 ID。
inbox Object 通道資訊。
id String 通道 ID。
name String 通道名稱。
channel_type String 通道類型。
provider String 廠商,例如通道為 whatsapp,對應值為 whatsapp_cloud/engagelab_whatsapp/twilio。不區分廠商的通道為空值 null。
Icon Solid Transparent White Qiyu
聯繫銷售