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 |
请求示例
curl --location --request POST 'https://keyue.cloud.baidu.com/open/v1/api/v2/faq/standard/create' \
--header 'token: a9dcb88a-4fc0-4ae0-a103-3578bdb90e62' \
--header 'Content-Type: application/json' \
--header 'uid: cf7d9692703d45d1b5517a30ab3efa53' \
--header 'username: pnstest5' \
--data '{
"answer": {
"list": [
{
"id": "GW_h99V4uKrtAmY_r2J2NnPnjj-OasCgRtoA",
"type": 1,
"text": "没有",
"url": "",
"richText": ""
}
],
"type": 0
},
"question": "你吃饭了没2",
"dirId": "0",
"channelAnswers": [],
"expire": "2099-12-31 23:59:59",
"effect": "2024-06-04 17:05:05",
"simQuestions": [
"额外任务",
"撒打算"
],
"templates": [
[
{
"text": "["
},
{
"type": "entity",
"id": "h445a70a",
"character": "肯定",
"nameZh": "肯定",
"name": "h445a70a",
"children": [
{
"text": ""
}
]
},
{
"text": "]"
}
],
[
{
"text": "撒打算"
}
],
[
{
"text": "["
},
{
"type": "voca",
"id": "675243b8-eeb3-4123-9f37-2e61976ad9f6",
"character": "test",
"nameZh": "",
"name": "test",
"children": [
{
"text": ""
}
]
},
{
"text": "]"
}
]
],
"knowledgeLabelValue": {
"aaa": [
"111",
"222",
"33"
]
}
}'
响应示例
{
"time": 1736238237677,
"data": {
"id": "7e5bc5f5-b6d6-4713-b2ef-a55733daf8b7"
},
"code": 4002801,
"msg": "新建问答标准问题成功"
}