連絡先リストを取得
開発者は、この 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)'
このコードブロックはフローティングウィンドウ内に表示されます
リクエストヘッダー
| Field | Type | Description |
|---|---|---|
| Authorization | string | Authorization: Basic base64(API Key:API Secret) を使用して認証します。API Keys ページで API Key と API Secret を取得し、コロンで連結して Base64 エンコードします。 |
| Content-Type | application/json | データ型。通常のテキストメッセージには application/json を使用します。 |
クエリパラメータ
| Field | Type | Required | Description |
|---|---|---|---|
| page | integer | No | ページ番号。デフォルトは 1 で、1 ページあたり 15 件です。 |
| page_size | integer | No | 1 ページあたりの件数を指定します。 |
| 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": [
{
"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": [
{
"source_id": "src_001",
"inbox": {
"id": 10,
"name": "Customer Service Channel",
"channel_type": "Channel::Api"
}
}
]
}
]
}
このコードブロックはフローティングウィンドウ内に表示されます
include_contact_inboxes=true の場合、contact_inboxes が返されます。
レスポンスパラメータ
| Field | Type | Required | Description |
|---|---|---|---|
| meta | Object | No | メタデータオブジェクト。 |
| count | Integer | No | クエリ結果の件数。 |
| current_page | Integer | No | 現在のクエリ結果のページ番号。 |
| payload | Array | No | 連絡先の属性。 |
| additional_attributes | Object | No | 追加属性。 |
| availability_status | String | No | オンライン状態。デフォルトは offline です。 |
| String | No | メールアドレス。 | |
| id | Integer | No | 連絡先 ID。 |
| name | String | No | 名前。 |
| phone_number | String | No | 電話番号。 |
| blocked | Boolean | No | 連絡先がブロックされているかどうか。デフォルトは false です。 |
| identifier | String | No | ユーザー識別子。 |
| thumbnail | String | No | ユーザーのサムネイル。 |
| custom_attributes | Object | 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 | Integer | No | 受信トレイ ID。 |
| name | String | No | 受信トレイ名。 |
| channel_type | String | No | チャネルタイプ。 |
エラーレスポンス
レスポンスパラメータ
| HTTP Status Code | Description |
|---|---|
| 401 | 認証されていません。トークンが無効または存在しません。 |
| 403 | 権限が不足しています。 |










