更新聯絡人
開發者可透過 API 更新聯絡人資訊。
請求方式
PATCH
請求 URL
https://livedesk-api.engagelab.com/api/v2/accounts/contacts/:id
身分驗證
詳情請參閱 API 概覽 中的身分驗證說明。
請求
請求範例
curl -X PATCH https://livedesk-api.engagelab.com/api/v2/accounts/contacts/:id \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"additional_attributes":
{
"description": "",
"company_name": "",
"city": "",
"telegram": "",
"country": "",
"country_code": "",
"social_profiles":
{
"facebook": "",
"github": "",
"instagram": "",
"linkedin": "",
"twitter": ""
}
},
"availability_status": "offline",
"email": "support@jiguang.cn",
"name": "support",
"phone_number": null,
"blocked": false,
"identifier": "2222",
"thumbnail": "",
"last_activity_at": 1765441908,
"custom_attributes":
{ // 選填:合併並更新自訂欄位(增量合併)
"vip_level": "platinum"
},
"created_at": 1765441895,
"first_name": "support",
"last_name": ""
}
curl -X PATCH https://livedesk-api.engagelab.com/api/v2/accounts/contacts/:id \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"additional_attributes":
{
"description": "",
"company_name": "",
"city": "",
"telegram": "",
"country": "",
"country_code": "",
"social_profiles":
{
"facebook": "",
"github": "",
"instagram": "",
"linkedin": "",
"twitter": ""
}
},
"availability_status": "offline",
"email": "support@jiguang.cn",
"name": "support",
"phone_number": null,
"blocked": false,
"identifier": "2222",
"thumbnail": "",
"last_activity_at": 1765441908,
"custom_attributes":
{ // 選填:合併並更新自訂欄位(增量合併)
"vip_level": "platinum"
},
"created_at": 1765441895,
"first_name": "support",
"last_name": ""
}
此代碼塊在浮窗中顯示
請求 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。 |
路徑參數
| Field | Type | Required | Description |
|---|---|---|---|
| account | integer | Yes | 帳號 ID |
| id | integer | Yes | 聯絡人 ID |
請求 Body 參數
| Field | Type | Required | Description |
|---|---|---|---|
| additional_attributes | Object | No | 附加屬性。 |
| description | Object | No | 補充描述。 |
| company_name | String | No | 公司名稱。 |
| city | String | No | 城市。 |
| telegram | String | No | Telegram 聯絡方式。 |
| country | String | No | 國家。 |
| country_code | String | No | 國家代碼。 |
| social_profiles | String | No | 社群媒體聯絡資訊。 |
| availability_status | String | No | 在線狀態,預設為 offline。 |
| String | No | 電子郵件地址。 | |
| name | String | No | 名稱。 |
| phone_number | String | No | 電話號碼。 |
| blocked | String | No | 是否已封鎖,預設為 false。 |
| identifier | String | No | 聯絡人的外部唯一識別碼,對應介面中顯示的 UserID。 |
| thumbnail | String | No | 聯絡人頭像 URL。 |
| last_activity_at | String | No | 最後更新時間戳。 |
| created_at | String | No | 建立時間戳。 |
| first_name | String | No | 聯絡人名字。 |
| last_name | Array | No | 聯絡人姓氏。 |
| custom_attributes | object | No | 自訂欄位。 |
回應範例
{
"payload": {
"additional_attributes": {
"description": "",
"company_name": "",
"city": "",
"telegram": "",
"country": "",
"country_code": "",
"social_profiles": {
"facebook": "",
"github": "",
"instagram": "",
"linkedin": "",
"twitter": ""
}
},
"availability_status": "offline",
"email": "support@jiguang.cn",
"id": 318763,
"name": "support",
"phone_number": null,
"blocked": false,
"identifier": "2222",
"thumbnail": "",
"custom_attributes": {},
"last_activity_at": 1765441908,
"created_at": 1765441895,
"contact_inboxes":[
{
"source_id": "src_001",
"inbox": {
"id": 10,
"name": "客服渠道",
"channel_type": "Channel::Api"
}
}
]
}
}
{
"payload": {
"additional_attributes": {
"description": "",
"company_name": "",
"city": "",
"telegram": "",
"country": "",
"country_code": "",
"social_profiles": {
"facebook": "",
"github": "",
"instagram": "",
"linkedin": "",
"twitter": ""
}
},
"availability_status": "offline",
"email": "support@jiguang.cn",
"id": 318763,
"name": "support",
"phone_number": null,
"blocked": false,
"identifier": "2222",
"thumbnail": "",
"custom_attributes": {},
"last_activity_at": 1765441908,
"created_at": 1765441895,
"contact_inboxes":[
{
"source_id": "src_001",
"inbox": {
"id": 10,
"name": "客服渠道",
"channel_type": "Channel::Api"
}
}
]
}
}
此代碼塊在浮窗中顯示
回應參數
| Field | Type | Required | Description |
|---|---|---|---|
| payload | Object | No | 屬性結構。 |
| additional_attributes | Object | No | 附加屬性。 |
| availability_status | String | No | 在線狀態,預設為 offline。 |
| 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 | 關聯渠道資訊,僅在 include_contact_inboxes=true 時回傳 |
|
| source_id | String | No | 來源 ID。 |
| inbox | Object | No | 收件匣資訊。 |
| id | Integer | No | 收件匣 ID。 |
| name | String | No | 收件匣名稱。 |
| channel_type | String | No | 渠道類型。 |










