FaqStandardCreate - 新建标准问
更新时间:2025-01-24
API访问域名
请求方式 | POST |
---|---|
base url | https://keyue.cloud.baidu.com |
后缀接口 | /open/v1/api/v2/faq/standard/create |
Authentication | token为API Key |
说明
无
请求参数
Header参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
Content-Type | string | 是 | 内容类型 | 固定值:application/json |
token | string | 是 | API KEY | 集成-API-API Key处获取。 详细获取方式参考:准备工作 |
uid | string | 是 | 用户ID | 鼠标移动至页面右上角账户头像即可获取。 详细获取方式参考:准备工作 |
username | string | 是 | 用户名 | 鼠标移动至页面右上角账户头像即可获取。 详细获取方式参考:准备工作 |
Body参数
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
question | string | 是 | 问题 | 今天天气怎么样呢 |
dirId | string | 是 | 所属目录ID | 0 |
expire | string | 是 | 过期时间 | 2099-12-31 23:59:59 |
effect | string | 是 | 生效时间 | 2024-05-28 11:22:28 |
channelAnswers | array | 否 | 渠道答案 | [],固定值 |
answer | object | 是 | 答案 | 答案对象 ,详见answer子数据 |
simQuestions | list[string] | 否 | 相似问题 | |
templates | list |
否 | 问题模板 | 详见templates子数据 |
knowledgeLabelValue | Map<String, List |
否 | 知识标签值 | 支持以值的方式传入标签 { "标签名1": ["标签值1", "标签值2"], "标签名2": ["标签值1", "标签值2"] } |
answer子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
list | array | 是 | 列表 | 列表,详见list子数据 |
type | integer | 是 | 类型 | 0,固定 |
list子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
id | string | 是 | ID | UUID |
type | integer | 是 | 类型 | 1文本、3富文本、4图片链接 |
text | string | 否 | 文本 | 晴天 |
url | string | 否 | URL | |
richText | string | 否 | 富文本 |
templates子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
text | string | 否 | 模版文本 | |
type | string | 否 | 类型 | 当插入词库/实体时,需提供。词库为voca,实体为entity。 |
id | string | 否 | 名称 | 插入的词库/实体id |
name | string | 否 | 名称 | |
nameZH | string | 否 | 中文名 |
响应参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
time | integer | 是 | 时间 | 1716985128196 |
data | obj | 是 | 数据 | 数据对象,详见data 子数据 |
code | integer | 是 | 状态码 | 4002801 |
msg | string | 是 | 状态信息 | 新建问答标准问题成功 |
data 子数据
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
id | string | 是 | 标准问ID | bfbd5efa-029a-4856-b2e5-59a93e5b6900 |
请求示例
Bash
1curl --location --request POST 'https://keyue.cloud.baidu.com/open/v1/api/v2/faq/standard/create' \
2--header 'token: a9dcb88a-4fc0-4ae0-a103-3578bdb90e62' \
3--header 'Content-Type: application/json' \
4--header 'uid: cf7d9692703d45d1b5517a30ab3efa53' \
5--header 'username: pnstest5' \
6--data '{
7 "answer": {
8 "list": [
9 {
10 "id": "GW_h99V4uKrtAmY_r2J2NnPnjj-OasCgRtoA",
11 "type": 1,
12 "text": "没有",
13 "url": "",
14 "richText": ""
15 }
16 ],
17 "type": 0
18 },
19 "question": "你吃饭了没2",
20 "dirId": "0",
21 "channelAnswers": [],
22 "expire": "2099-12-31 23:59:59",
23 "effect": "2024-06-04 17:05:05",
24 "simQuestions": [
25 "额外任务",
26 "撒打算"
27 ],
28 "templates": [
29 [
30 {
31 "text": "["
32 },
33 {
34 "type": "entity",
35 "id": "h445a70a",
36 "character": "肯定",
37 "nameZh": "肯定",
38 "name": "h445a70a",
39 "children": [
40 {
41 "text": ""
42 }
43 ]
44 },
45 {
46 "text": "]"
47 }
48 ],
49 [
50 {
51 "text": "撒打算"
52 }
53 ],
54 [
55 {
56 "text": "["
57 },
58 {
59 "type": "voca",
60 "id": "675243b8-eeb3-4123-9f37-2e61976ad9f6",
61 "character": "test",
62 "nameZh": "",
63 "name": "test",
64 "children": [
65 {
66 "text": ""
67 }
68 ]
69 },
70 {
71 "text": "]"
72 }
73 ]
74 ],
75 "knowledgeLabelValue": {
76 "aaa": [
77 "111",
78 "222",
79 "33"
80 ]
81 }
82}'