分页列出工作空间下的文件,按 created_at 倒序返回。可通过 scope_id 仅列出某会话沙箱内的文件。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
GET /files
Query 参数
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
limit | int | 20 | 每页数量,最大 100 |
page | string | — | 首次不传,后续传上一次响应的 next_page |
scope_id | string | — | 传入会话 ID,仅返回该会话沙箱内的文件 |
请求示例
响应示例
data(File 对象数组)与 next_page。File 对象字段如下:
File 对象字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 文件 ID,格式 file_<24位字母数字> |
type | string | 固定为 file |
filename | string | 文件名 |
mime_type | string | 服务端检测的 MIME 类型 |
size_bytes | int | 文件大小,单位字节 |
downloadable | bool | 是否支持下载,当前接口直传与会话沙箱拷贝均为 false |
status | string | 安全审核状态:available / checking / rejected / type_rejected |
created_at | string | 上传时间,ISO 8601 |