List Contact
Developers can query the contact list under the account through the API.
Request Method
GET
Request URL
https://livedesk-api.engagelab.com/api/v2/accounts/contacts
Authentication
For details, see the authentication method description in API Overview.
Request
Request Example
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)' \
Este bloque de código se muestra en una ventana flotante
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | string | Use Authorization: Basic base64(API Key:API Secret) for authentication. Please go to the API Key page to obtain API Key and API Secret, connect them with a colon, and then Base64 encode them. |
| Content-Type | application/json | Data type, use application/json for plain text messages. |
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number, default 1, 15 items per page |
| labels | string / string[] | No | Filter by labels, supports multiple labels (any match) |
| include_contact_inboxes | boolean | No | Whether to return contact_inboxes, default true |
| sort | string | No | Sort field, optional values: email、name、phone_number、last_activity_at、created_at、company、city、country |
| direction | string | No | Sort direction, asc or desc |
Successful Response
Response Example
{
"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": [ // Returned when include_contact_inboxes=true
{
"source_id": "src_001",
"inbox":
{
"id": 10,
"name": "Customer Service Channel",
"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": [ // Returned when include_contact_inboxes=true
{
"source_id": "src_001",
"inbox":
{
"id": 10,
"name": "Customer Service Channel",
"channel_type": "Channel::Api"
}
}
]
}
]
}
Este bloque de código se muestra en una ventana flotante
Response Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| meta | Object | No | Metadata object. |
| count | Int | No | Query result count. |
| current_page | Int | No | Current query result page number. |
| payload | Object | No | Attributes. |
| additional_attributes | Object | No | Additional attributes. |
| availability_status | String | No | Online status, default is offline. |
| String | No | Email address. | |
| id | String | No | Contact ID. |
| name | String | No | Name |
| phone_number | String | No | Phone number. |
| blocked | String | No | Whether blocked, default is false. |
| identifier | String | No | User identifier. |
| thumbnail | String | No | User identifier. |
| custom_attributes | Object | No | Customer attributes. |
| created_at | String | No | Creation timestamp. |
| last_activity_at | String | No | Last activity timestamp. |
| created_at | String | No | Timestamp when this contact was created. |
| contact_inboxes | array | Associated channel information, returned only when 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. |
Error Response
Response Parameters
| HTTP Status Code | Description |
|---|---|
| 401 | Unauthorized, Token is invalid or missing |
| 403 | Insufficient permissions |
