Logo Site EngageLab Mark Colored Transparent文档
搜索

获取联系人列表

开发者可以通过 API 查询账号下的联系人列表。

请求方式

GET

调用地址

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

            
此代码块在浮窗中显示

请求头

字段 类型 描述
Authorization string 使用 Authorization: Basic base64(API Key:API Secret) 进行身份验证。请前往 API 密钥页面 获取 API Key 和 API Secret,并将两者以冒号连接后进行 Base64 编码。
Content-Type application/json 数据类型,普通文字消息使用 application/json。

查询参数

字段 类型 必填 描述
page integer 页码,默认 1,每页 15 条
labels string / string[] 按标签过滤,支持多个标签(any 匹配)
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": { "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"
              }
             }
          ]
        }
    ]
}

            
此代码块在浮窗中显示

响应参数

字段 类型 必填 描述
meta Object 元数据对象。
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 是否锁定,默认falese。
identifier String 用户标识。
thumbnail String 用户标识。
custom_attributes Object 客户属性。
created_at String 创建时间戳。
last_activity_at String 最后一次活跃的时间戳。
created_at String 该联系人创建的时间戳。
contact_inboxes array 关联的渠道信息,仅在 include_contact_inboxes=true 时返回
source_id String No Source ID.
inbox Object No Inbox information.
id Integer No Inbox ID.
name String No Inbox name.
channel_type String No Channel type.

错误响应

响应参数

HTTP 状态码 说明
401 未授权,Token 无效或缺失
403 权限不足
Icon Solid Transparent White Qiyu
联系销售