获取文件元数据
更新时间:2026-11-13
GET
https://api.dumate.cn/api/dma/v1/files/{file_id}
本接口用于查询单个文件(File)的元数据,支持上传文件和会话产物。
权限说明
使用 API Key 鉴权调用 API 流程,具体调用流程,请查看认证鉴权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
URL 参数
file_id
string
文件标识。
文件不存在时返回 404。
必选
Query 参数
scope_id
string
会话产物所在的会话标识。
file_id 为 art_ 前缀时必填,不传返回 400;file_id 为其他前缀时不要传,传了返回 400。
可选
请求结构
GET /api/dma/v1/files/{file_id} HTTP/1.1
Host: api.dumate.cn
Authorization: Bearer <YOUR_API_KEY>
示例代码
请求示例
curl --location --request GET "https://api.dumate.cn/api/dma/v1/files/art_843cb198-5a86-4a61-8604-75fff5b2ea38?scope_id=ses_gffe5e3f6e5a70ffeZ677h1hJ6F9cHO" \
--header 'Authorization: Bearer <YOUR_API_KEY>'
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
type
string
资源类型标识,固定为 file。
可选
id
string
文件标识。
上传文件通常为 node_ 前缀,会话产物为 art_ 前缀。
可选
filename
string
文件名。
可选
mime_type
string
文件的 MIME 类型。
会话产物取不到类型时为 application/octet-stream。
可选
size_bytes
integer
文件大小,单位为字节。
会话产物优先取实际下载大小,与下载接口返回的字节数一致。
可选
created_at
string
创建时间,RFC 3339 格式,UTC。
会话产物取不到时间时不返回该字段。
可选
downloadable
boolean
是否可下载。
可选
expires_at
string
过期时间,RFC 3339 格式,UTC;不过期时为 null。
可选
scope
object {2}
文件的作用范围。
仅会话产物返回。
可选
显示子属性
隐藏子属性
type
string
作用范围类型,固定为 session。
可选
id
string
产物所在的会话标识。
可选
响应示例
{
"type": "file",
"id": "art_843cb198-5a86-4a61-8604-75fff5b2ea38",
"filename": "hello.txt",
"mime_type": "application/octet-stream",
"size_bytes": 32,
"created_at": "2026-11-09T13:49:24Z",
"downloadable": true,
"expires_at": null,
"scope": {
"type": "session",
"id": "ses_gffe5e3f6e5a70ffeZ677h1hJ6F9cHO"
}
}
评价此篇文章
