FaqStandardUpdate - 修改标准问
更新时间:2025-12-26
API访问域名
| 请求方式 | POST |
|---|---|
| base url | https://keyue.cloud.baidu.com |
| 后缀接口 | /open/v1/api/v2/faq/standard/update |
| Authentication | token为API Key |
说明
无
请求参数
Header参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| Content-Type | string | 是 | 内容类型 | 固定值:application/json |
| token | string | 是 | API KEY | 机器人API KEY。 详细获取方式参考:准备工作 |
| uid | string | 是 | 用户ID | 详细获取方式参考:准备工作 |
| username | string | 是 | 用户名 | 详细获取方式参考:准备工作 |
Body参数
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| id | string | 是 | faq id | 通过list或者detail接口获取 |
| question | string | 是 | 问题 | 标准问题 |
| dirId | string | 是 | 所属目录ID | 0 |
| editVersion | integer | 否 | faq版本号 | 版本号随修改增加,需通过list或者detail接口获取 |
| effect | string | 是 | 生效时间 | 2024-05-28 11:22:28 |
| expire | string | 是 | 过期时间 | 2099-12-31 23:59:59 |
| clarity | integer | 是 | 是否澄清 | 0-否 1-是 |
| status | integer | 是 | 是否生效 | 0-是 1-否 |
| faqType | integer | 是 | faq 类型 | 0-机器人内部知识 1-公共知识 |
| faqI18n | integer | 是 | 是否国际化 | 0-否 1是 |
| exeInstruct | bool | 是 | 是否执行指令 | false/true |
| instructions | array | 是 | 指令列表 | 0 |
| knowledgeLabelValue | Map<String, List |
否 | 知识标签值 | 支持以值的方式传入标签 { "标签名1": ["标签值1", "标签值2"], "标签名2": ["标签值1", "标签值2"] } |
| simQuestions | list[string] | 否 | 相似问题 | |
| templates | list |
否 | 问题模板 | 详见templates子数据 |
| answer | object | 是 | 答案 | 答案对象,answer和channelAnswers至少填其中一个,详见answer子数据 |
| channelAnswers | array | 否 | 渠道答案 | 渠道答案 ,channelAnswers 和 answer 至少填其中一个,详见channelAnswers子数据 |
templates子数据
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| text | string | 否 | 模版文本 | |
| type | string | 否 | 类型 | 当插入词库/实体时,需提供。词库为voca,实体为entity。 |
| id | string | 否 | 名称 | 插入的词库/实体id |
| name | string | 否 | 名称 | |
| nameZH | string | 否 | 中文名 |
answer子数据
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| type | integer | 是 | 类型 | 0,固定 |
| list | array | 是 | 列表 | 列表,详见list子数据 |
list子数据
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| id | string | 是 | ID | UUID |
| type | integer | 是 | 类型 | 1文本、3富文本、4图片链接 |
| text | string | 否 | 文本 | 晴天 |
| url | string | 否 | URL | |
| richText | string | 否 | 富文本 |
channelAnswers子数据
说明:修改时不传该参数,表示删除条件答案
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| answer | object | 否 | 答案 | 答案对象,详见answer子数据 |
| condition | object | 否 | 条件参数 | ,详见condition子数据 |
| exeInstruct | bool | 是 | 是否执行指令 | false/true |
| instructions | array | 是 | 指令列表 | 0 |
answer子数据
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| list | array | 否 | 答案列表 | |
| list \ id | string | 是 | ID | 需要生成一个 UUID |
| list \ type | integer | 是 | 类型 | 1文本、3富文本、4图片链接 |
| list \ text | string | 是 | 答案文本 | |
| list \ url | string | 否 | URL |
condition子数据
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| dateCondition | bool | 否 | 是否时间条件 | 存在对应条件时为 true,否则为 false |
| channelCondition | bool | 否 | 是否渠道条件 | |
| paramsCondition | bool | 否 | 是否参数条件 | |
| expressionSnapshot | object | 否 | 参数表达式 | 详见expressionSnapshot子数据 |
expressionSnapshot子数据
| 名称 | 类型 | 必填 | 中文名 | 说明 |
|---|---|---|---|---|
| id | string | 是 | ||
| name | string | 否 | ||
| type | string | 是 | 正交类型 | and-并且 or-或 |
| value | array | 是 | 条件答案 | |
| value \ id | string | 是 | ||
| value \ logicInterface | string | 是 | 参数类型 | variable-变量 entity-实体 |
| value \ type | string | 是 | 比较类型 | equal-相等 |
| value \ value | array | 是 | 具体参数 | |
| value \ value \ type | string | 是 | 参数类型 | variable-变量 entity-实体 |
| value \ value \ type \ value | string | 是 | 参数名称 |
响应参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| time | integer | 是 | 时间 | 1716985128196 |
| data | null | 是 | 数据 | null |
| code | integer | 是 | 状态码 | 4002801 |
| msg | string | 是 | 状态信息 | 编辑问答标准问题成功 |
请求示例
Bash
1curl --location --request POST 'https://keyue.cloud.baidu.com/open/v1/api/v2/faq/standard/update' \
2--header 'token: xxxx' \
3--header 'Content-Type: application/json' \
4--header 'uid: cf7d9692703d45d1b5517a30ab3efa53' \
5--header 'username: pnstest5' \
6--data '{
7 "id": "150f8b60-e224-4dae-b639-156d53278938",
8 "question": "标准问题-修改",
9 "dirId": "0",
10 "editVersion": 0,
11 "effect": "2025-06-24 18:01:21",
12 "expire": "2099-12-31 23:59:59",
13 "clarity": 1,
14 "status": 0,
15 "faqType": 0,
16 "faqI18n": 0,
17 "knowledgeLabelValue":{
18 "标签1":["第一个"]
19 },
20 "simQuestions": [
21 "相似问题1-修改",
22 "相似问题2",
23 "相似问题3"
24 ],
25 "templates": [
26 [
27 {
28 "text": "~引用实体的模板["
29 },
30 {
31 "type": "entity",
32 "id": "H922e277",
33 "nameZh": "手机号码",
34 "name": "H922e277"
35 },
36 {
37 "text": "]"
38 }
39 ]
40 ],
41 "answer": {
42 "list": [
43 {
44 "id": "answer1",
45 "type": 1,
46 "text": "通用答案-修改",
47 "url": ""
48 }
49 ],
50 "needBackGuide": true,
51 "type": 0
52 },
53 "channelAnswers": [
54 {
55 "answer": [
56 {
57 "id": "channelAnswers1",
58 "type": 1,
59 "text": "进行变量判断的条件答案-修改",
60 "url": "",
61 "audioInfo": {}
62 }
63 ],
64 "needBackGuide": true,
65 "exeInstruct": false,
66 "instructions": [],
67 "condition": {
68 "dateCondition": false,
69 "dateScope": {},
70 "channelCondition": false,
71 "channel": [],
72 "paramsCondition": true,
73 "expressionSnapshot": {
74 "id": "expressionSnapshot1",
75 "name": "",
76 "type": "and",
77 "value": [
78 {
79 "id": "expression1",
80 "logicInterface": "variable",
81 "type": "equal",
82 "value": [
83 {
84 "type": "variable",
85 "value": "str"
86 },
87 {
88 "type": "value",
89 "value": "变量条件"
90 }
91 ]
92 }
93 ]
94 }
95 }
96 }
97 ]
98}'
响应示例
1{
2 "time": 1750753356738,
3 "data": null,
4 "code": 4002801,
5 "msg": "编辑问答标准问题成功"
6}
1{
2 "msg": "标准问题或扩展问数据版本不一致,请重试",
3 "tip": "",
4 "code": 4000527,
5 "requestId": "cde8ff97b4264dfa8b553c64859bf8dd"
6}
