获取文件列表
更新时间:2026-11-13
GET
https://api.dumate.cn/api/dma/v1/files?limit=2
本接口用于分页查询文件(File)列表。
权限说明
使用 API Key 鉴权调用 API 流程,具体调用流程,请查看认证鉴权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
Query 参数
scope_id
string
会话标识。
传入后返回该会话可见的上传文件和会话产物。
会话不存在时返回 404;会话不属于当前账号时返回 403。
可选
limit
integer
每页条数,默认 20,取值 1–1000。
超出范围时返回 400。
可选
page
string
翻页游标,取上一页响应的 next_page;第一页不传。
游标无效时返回 400;传入 scope_id 时游标与该会话绑定,用于其他会话返回 400。
可选
ids[]
array
只返回指定标识的文件,也支持 ids=a,b 写法,一次返回全部命中结果。
不能与 page、limit 同时使用,否则返回 400。
可选
显示子属性
隐藏子属性
items
string
请求结构
GET /api/dma/v1/files?limit=2 HTTP/1.1
Host: api.dumate.cn
Authorization: Bearer <YOUR_API_KEY>
示例代码
请求示例
curl --location --request GET "https://api.dumate.cn/api/dma/v1/files?limit=2" \
--header 'Authorization: Bearer <YOUR_API_KEY>'
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
data
array
文件(File)列表。
可选
显示子属性
隐藏子属性
items
object {9}
显示子属性
隐藏子属性
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
产物所在的会话标识。
可选
next_page
string
下一页游标;没有下一页时为 null。
可选
响应示例
{
"data": [
{
"type": "file",
"id": "node_g001a1c08f2611001leua8pmtA3UaVj",
"filename": "demo2.txt",
"mime_type": "text/plain",
"size_bytes": 27,
"created_at": "2026-11-09T13:46:09Z",
"downloadable": true,
"expires_at": "2026-11-09T14:46:09Z"
},
{
"type": "file",
"id": "node_g001a1c08f2357001N6XJI9EQ3cLNJr",
"filename": "demo.txt",
"mime_type": "text/plain",
"size_bytes": 27,
"created_at": "2026-11-09T13:46:08Z",
"downloadable": true,
"expires_at": null
}
],
"next_page": "page_Mg"
}
评价此篇文章
