更新联系人
开发者可以通过 API 更新联系人信息。
请求方式
PATCH
调用地址
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": ""
}
此代码块在浮窗中显示
请求头
| 字段 | 类型 | 描述 |
|---|---|---|
| Authorization | string | 使用 Authorization: Basic base64(API Key:API Secret) 进行身份验证。请前往 API 密钥页面 获取 API Key 和 API Secret,并将两者以冒号连接后进行 Base64 编码。 |
| Content-Type | application/json | 数据类型,普通文字消息使用 application/json。 |
Path参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| account | integer | 是 | 账户 ID |
| id | integer | 是 | 联系人 ID |
请求体参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| additional_attributes | Object | 否 | 附件属性。 |
| description | Object | 否 | 附件属性。 |
| company_name | String | 否 | 公司名称。 |
| city | String | 否 | 城市。 |
| telegram | String | 否 | Telegram联系方式。 |
| country | String | 否 | 国家。 |
| country_code | String | 否 | 国家代码。 |
| social_profiles | String | 否 | 社交软件联系方式。 |
| availability_status | String | 否 | 在线状态,默认为offline。 |
| String | 否 | 邮件地址。 | |
| name | String | 否 | 名称 |
| phone_number | String | 否 | 手机号码。 |
| blocked | String | 否 | 是否锁定,默认falese。 |
| identifier | String | 否 | 联系人外部唯一标识,对应界面显示的UserID。。 |
| thumbnail | String | 否 | 联系人头像 URL。 |
| last_activity_at | String | 否 | 最新更新时间戳。 |
| created_at | String | 否 | 创建时间戳。 |
| first_name | String | 否 | 联系人姓。 |
| last_name | Array | 否 | 联系人名字。 |
| custom_attributes | object | 自定义字段 |
响应示例
{
"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"
}
}
]
}
}
此代码块在浮窗中显示
响应参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| payload | Object | 否 | 属性结构。 |
| additional_attributes | Object | 否 | 附件属性。 |
| availability_status | String | 否 | 在线状态,默认为offline。 |
| String | 否 | 邮件地址。 | |
| id | String | 否 | 联系人ID。 |
| name | String | 否 | 名称 |
| phone_number | String | 否 | 手机号码。 |
| blocked | String | 否 | 是否锁定,默认falese。 |
| 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 | 否 | 通道类型。 |
