知识库Agent Tool操作接口
批量下载文档
批量下载文档原文件或可下载内容。
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| spaceId | int64 | 是 | 知识库空间 ID。 | 123456 |
| docIds | int64[] | 是 | 文档 ID 列表。 | [987654] |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 业务响应码。200 表示成功;失败时为 RetCode 中定义的业务码。 | 200 |
| msg | string | 响应说明。成功通常为 ok;失败时为错误原因。 | ok |
| message | string | 兼容字段,部分异常场景可能返回错误说明。 | |
| data | object | 批量导出或下载结果。 | |
| └total | int32 | 总数。 | 3 |
| └success | int32 | 成功数。 | 3 |
| └downloadUrls | string[] | 下载地址列表。 | ["https://example.com/download"] |
错误码
| 状态码 | 描述 |
|---|---|
| 400 | 请求参数错误。常见业务码:402 MISS_PARAM、403 ERR_PARAM。 |
| 401 | PERSONAL_API 鉴权失败。常见业务码:405 AUTH_FAILED。 |
| 403 | 权限不足。常见业务码:406 FORBIDDEN。 |
| 404 | 资源不存在。常见业务码:404 NOT_FOUND。 |
| 500 | 服务内部异常。常见业务码:500 ERROR。 |
postEndpoint
/api/athena/agent/tool/batchDownloadcurl -X POST "https://b.163.com/api/athena/agent/tool/batchDownload" \ -H "Content-Type: application/json" \ -d '{ "spaceId": 123456, "docIds": [ 987654 ] }'{
"code": 200,
"msg": "ok",
"message": "string",
"data": {
"total": 3,
"success": 3,
"downloadUrls": [
"https://example.com/download"
]
}
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}{
"code": 200,
"msg": "ok",
"message": "string"
}这篇文档有帮助吗?