获取文档下载地址
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
eventbridge:GetDocumentDownloadUrl |
get |
*KnowledgeBase
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Catalog |
string |
是 |
知识库所属的数据目录,与 Namespace、KnowledgeBaseName 共同定位知识库。可通过 ListCatalogs 获取 |
my_catalog |
| Namespace |
string |
是 |
知识库所属的命名空间,必须属于指定的数据目录,与 Catalog、KnowledgeBaseName 共同定位知识库。可通过 ListNamespaces 获取 |
my_namespace |
| KnowledgeBaseName |
string |
是 |
知识库名称,命名空间内唯一;创建时确定,不可修改 |
my-knowledge-base |
| DocumentId |
string |
是 |
文档 ID |
doc-bp1xxxxxxxxxxxx |
| NetworkType |
string |
否 |
预签名 URL 的网络类型。PUBLIC(默认):公网可达;INTERNAL:仅阿里云同地域内网可达,免公网流量费 |
PUBLIC |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| Code |
string |
接口返回码,Success 表示成功,失败时为具体错误码 |
Success |
| Data |
object |
文档下载 URL 信息 |
|
| DownloadUrl |
string |
短时有效的 GET 预签名 URL,客户端使用该地址下载原始文件 |
https://my-bucket.oss-cn-hangzhou.aliyuncs.com/kb/doc-bp1xxxxxxxxxxxx?Expires=1788000000&Signature=xxxx |
| ExpireAt |
string |
预签名下载地址的过期时间,ISO8601 UTC 格式 |
1756022400000 |
| Message |
string |
接口返回的提示信息,成功时为 Operation success,失败时为具体错误描述 |
Operation success |
| RequestId |
string |
请求 ID |
34AD682D-5B91-5773-8132-AA38C130**** |
| Success |
boolean |
本次调用是否成功,true 表示成功 |
true |
示例
正常返回示例
JSON格式
{
"Code": "Success",
"Data": {
"DownloadUrl": "https://my-bucket.oss-cn-hangzhou.aliyuncs.com/kb/doc-bp1xxxxxxxxxxxx?Expires=1788000000&Signature=xxxx",
"ExpireAt": "1756022400000"
},
"Message": "Operation success",
"RequestId": "34AD682D-5B91-5773-8132-AA38C130****",
"Success": true
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid | |
| 403 | ServiceNotEnable | Service not enable | |
| 404 | KnowledgeBaseNotFound | The specified knowledge base does not exist | |
| 404 | DocumentNotFound | The specified document does not exist | |
| 404 | CatalogNotFound | The specified catalog does not exist | |
| 404 | NamespaceNotFound | The specified namespace does not exist | |
| 409 | InvalidDocumentStatus | The document status does not support this operation | |
| 409 | InvalidKnowledgeBaseStatus | The knowledge base status does not support this operation |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。