在线系统其他接口
更新会话自定义字段
更新指定会话的自定义字段信息。请求体包括 sessionId、status、category、description、customfield、templateId、categoryList 等字段。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| appKey | string | 是 | 应用 AppKey | |
| time | int64 | 是 | 请求时间戳(秒) | |
| checksum | string | 是 | 请求签名校验和 | |
| checksumAlgorithm | int32 | 否 | 签名算法:0 - 默认(SHA1),1 - SHA256 |
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| sessionId | int64 | 否 | 会话 ID | 123456 |
| status | int32 | 否 | 问题解决状态(客服标记) | 1 |
| category | int64 | 否 | 咨询分类 ID | 1001 |
| description | string | 否 | 会话备注 | 用户反馈问题已解决 |
| customfield | string | 否 | 自定义字段(JSON 字符串) | {"field1":"value1"} |
| templateId | int64 | 否 | 模板 ID | 10 |
| categoryList | int64[] | 否 | 多咨询分类 ID 列表 |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 状态码,200 表示成功 | 200 |
| message | object | 在线会话自定义字段 | |
| └templates | object[] | 服务小记模版列表 | |
| └id | int64 | 数据库 ID | 1 |
| └name | string | 模版名称 | 服务小记模版1 |
| └isDefault | int32 | 是否是默认模版:1-是,0-否 | 1 |
| └assignFields | object[] | 自定义字段分配列表 | |
| └id | int64 | 分配 ID | 1 |
| └name | string | 字段名称 | 客户姓名 |
| └type | int32 | 字段类型:0-文本,1-下拉菜单,2-多选,3-时间控件 | 0 |
| └description | string | 字段描述 | 文本输入 |
| └required | int32 | 是否必填 | 1 |
| └staffName | string | 客服名称 | 张三 |
| └valueEditable | int32 | 是否可编辑 | 1 |
| └system | int32 | 字段类型:0-自定义字段,1-系统默认字段 | 0 |
| └fieldId | int64 | 字段 ID | 1001 |
| └selectedTemplateId | int64 | 已选择的服务小记模版 ID | 10 |
| └historyFieldValues | object[] | 已填写的服务小记信息 | |
| └fieldId | int64 | 字段 ID | 1001 |
| └fieldValue | string | 字段值 | 张三 |
| └assignType | int32 | 分配类型 | 1 |
| └fieldName | string | 字段名称 | 客户姓名 |
| └sessionInfo | object | 在线会话信息 | |
| └resolvedStatus | int32 | 会话解决状态 | 1 |
| └category | object | 在线会话分类 | |
| └id | int64 | 分类 ID | 1 |
| └name | string | 分类名称 | 售前咨询 |
| └parentId | int64 | 父分类 ID | 0 |
| └rank | int32 | 排序权重 | 1 |
| └updateTime | int64 | 更新时间(毫秒时间戳) | 1699776000000 |
| └path | string | 分类路径 | 售前/咨询 |
| └pathIds | string | 分类路径 ID | 0/1 |
| └remarks | string | 咨询备注 | 用户反馈问题已解决 |
错误码
| 状态码 | 描述 |
|---|---|
| 14001 | AppKey 不存在 |
| 14002 | checksum 校验失败 |
| 14003 | 请求时间戳与服务器时间误差超过 10 分钟 |
| 14004 | 请求体 JSON 格式错误 |
| 14500 | 服务内部异常 |
postEndpoint
/openapi/online/session/customfield/updatecurl -X POST "https://qiyukf.com/openapi/online/session/customfield/update?appKey=string&time=0&checksum=string" \ -H "Content-Type: application/json" \ -d '{}'{
"code": 200,
"message": {
"templates": [
{
"id": 1,
"name": "服务小记模版1",
"isDefault": 1,
"assignFields": [
{
"id": 1,
"name": "客户姓名",
"type": 0,
"description": "文本输入",
"required": 1,
"staffName": "张三",
"valueEditable": 1,
"system": 0,
"fieldId": 1001
}
]
}
],
"selectedTemplateId": 10,
"historyFieldValues": [
{
"fieldId": 1001,
"fieldValue": "张三",
"assignType": 1,
"fieldName": "客户姓名"
}
],
"sessionInfo": {
"resolvedStatus": 1,
"category": {
"id": 1,
"name": "售前咨询",
"parentId": 0,
"rank": 1,
"updateTime": 1699776000000,
"path": "售前/咨询",
"pathIds": "0/1"
},
"remarks": "用户反馈问题已解决"
}
}
}{
"code": 14001,
"message": "AppKey 不存在"
}{
"code": 14002,
"message": "checksum 校验失败"
}{
"code": 14003,
"message": "请求时间戳与服务器时间误差超过 10 分钟"
}{
"code": 14004,
"message": "请求体 JSON 格式错误"
}{
"code": 14500,
"message": "服务内部异常"
}这篇文档有帮助吗?