IntentCreate - 创建意图
更新时间:2025-12-26
API访问域名
| 请求方式 | POST |
|---|---|
| base url | https://keyue.cloud.baidu.com |
| 后缀接口 | /open/v1/api/v3/intent/create |
| Authentication | token为API Key |
说明
无
请求参数
Header参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| Content-Type | string | 是 | 内容类型 | 固定值:application/json |
| token | string | 是 | API KEY | 机器人API KEY。 详细获取方式参考:准备工作 |
| uid | string | 是 | 用户ID | 详细获取方式参考:准备工作 |
| username | string | 是 | 用户名 | 详细获取方式参考:准备工作 |
Body参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| nameZh | string | 是 | 意图名称 | 意图名称 |
| description | string | 否 | 意图描述 |
响应参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| time | integer | 是 | 时间 | 1716985128196 |
| data | null | 是 | 数据 | 数据对象,详见data子数据 |
| code | integer | 是 | 状态码 | 200 |
| msg | string | 是 | 状态信息 | OK |
data子数据
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| intentId | string | 是 | 意图ID | 200 |
| intentName | string | 是 | 意图名 | OK |
请求示例
Bash
1curl --location --request POST 'https://keyue.cloud.baidu.com/open/v1/api/v3/intent/create' \
2--header 'token: xxxx' \
3--header 'uid: xxxx' \
4--header 'username: xxxxxxxx' \
5--header 'Content-Type: application/json' \
6--data '{"nameZh":"创建意图","description":"创建意图描述"}'
响应示例
1{
2 "time": 1730707881407,
3 "data": {
4 "intentName": "创建意图",
5 "intentId": "5fc72c8a-9a84-11ef-b01f-066ee02707d2"
6 },
7 "code": 200,
8 "msg": "OK"
9}
1{
2 "time": 1719316175124,
3 "data": null,
4 "code": 4000177,
5 "msg": "意图创建失败\r\n意图名已存在\r\n"
6}
