接口描述
为已就绪的会话物料签发限时下载链接。
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-urlAuthorization: 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 | 未配置会话物料下载链接签名器 |