知识库Agent Tool导航接口
查询空间列表
按可选 keyword 查询当前身份可访问的空间列表。
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| keyword | string | 否 | 空间名称关键词,可选。 | 产品 |
| types | string | 否 | 空间类型列表,多个值以逗号分隔;可选 -2、-1、0、1。 | 0,1 |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 业务响应码。200 表示成功;失败时为 RetCode 中定义的业务码。 | 200 |
| msg | string | 响应说明。成功通常为 ok;失败时为错误原因。 | ok |
| message | string | 兼容字段,部分异常场景可能返回错误说明。 | |
| data | object | 空间列表数据。 | |
| └spaces | object[] | 空间列表。 | |
| └spaceId | int64 | 空间 ID。 | 123456 |
| └anchor | string | 空间锚点标识。 | product |
| └type | int32 | 空间类型:0-普通空间,-1-七鱼机器人同步空间,-2-问题库,1-Lark 空间。 | 0 |
| └name | string | 空间名称。 | 产品知识库 |
| └description | string | 空间描述。 | 产品相关文档 |
| └docCount | int32 | 空间下文档数量。 | 42 |
错误码
| 状态码 | 描述 |
|---|---|
| 400 | 请求参数错误。常见业务码:402 MISS_PARAM、403 ERR_PARAM。 |
| 401 | PERSONAL_API 鉴权失败。常见业务码:405 AUTH_FAILED。 |
| 404 | 资源不存在。常见业务码:404 NOT_FOUND。 |
| 500 | 服务内部异常。常见业务码:500 ERROR。 |
postEndpoint
/api/athena/agent/tool/listSpacescurl -X POST "https://b.163.com/api/athena/agent/tool/listSpaces" \ -H "Content-Type: application/json" \ -d '{}'{
"code": 200,
"msg": "ok",
"message": "string",
"data": {
"spaces": [
{
"spaceId": 123456,
"anchor": "product",
"type": 0,
"name": "产品知识库",
"description": "产品相关文档",
"docCount": 42
}
]
}
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}这篇文档有帮助吗?