帮你快速理解、总结文档立即下载

获取会话物料下载链接

最近更新时间:2026-10-29 18:19:31
我的收藏

接口描述

为已就绪的会话物料签发限时下载链接。
POST /v2/enterprises/{enterpriseId}/managedagent/artifacts/{artifactId}/download-url

输入参数

路径参数

参数
类型
说明
enterpriseId
string
WorkBuddy 企业 ID
artifactId
string
等价于请求体字段 ArtifactId

查询参数

无

请求体

字段
类型
说明
ArtifactId
string
ArtifactId 物料 ID,必填。
ExpiredSeconds
integer
ExpiredSeconds 链接有效期,单位秒。缺省 DefaultDownloadURLExpireSeconds, 取值范围 [MinDownloadURLExpireSeconds, MaxDownloadURLExpireSeconds]。

输出参数

(200,业务出参包装在 code / data / msg / requestId 中)
DescribeSessionArtifactDownloadUrlResponse 对应 Action=DescribeSessionArtifactDownloadUrl 响应体。
字段
类型
说明
downloadUrl
string
DownloadUrl 限时预签名 GET 下载链接。
expiredTime
string
ExpiredTime 链接过期时间,RFC3339 UTC。
fileName
string
FileName 文件名。
fileSizeBytes
integer
FileSizeBytes 文件大小,单位字节。
fileSha256
string
FileSha256 文件 SHA256 摘要。

示例

输入示例

POST /v2/enterprises/{enterpriseId}/managedagent/artifacts/{artifactId}/download-url
Authorization: Bearer pt_<YOUR_APP_KEY>
Content-Type: application/json

{
"ArtifactId": "1200345678901234567",
"ExpiredSeconds": 3600
}

输出示例

{
"code": 0,
"data": {
"downloadUrl": "https://example.com/download/pkg-001.zip",
"expiredTime": "2026-10-20T09:30:00Z",
"fileName": "report-2026-10-20.xlsx",
"fileSha256": "9f2c4b1e7a3d5c8b0f1a2e3d4c5b6a7980fedcba0123456789abcdef01234567",
"fileSizeBytes": 184320
},
"msg": "OK",
"requestId": "3c6d138e-1234-5678-9abc-def012345678"
}

错误码

说明:
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见错误响应与公共错误码。
错误码
说明
FailedOperation.SessionArtifactNotReady
会话物料尚未就绪,无法下载(未 READY 或已超过保留期)
InternalError.SessionArtifactOperationFailed
会话物料操作失败
InvalidParameter.ArtifactIDRequired
缺少 ArtifactId
InvalidParameter.InvalidRequestBody
请求体不合法
InvalidParameterValue.InvalidExpireSeconds
ExpiredSeconds 必须在 60~86400 秒之间
MissingParameter.UinRequired
公共参数中缺少 Uin
ResourceNotFound.Session
会话不存在
ResourceNotFound.SessionArtifact
会话物料不存在
ResourceUnavailable.SessionArtifactServiceUnavailable
未配置会话物料下载链接签名器