获取文件元数据

更新时间:
复制为 MD 格式

根据文件 ID 获取单个文件的详细元数据信息。

请求头

头部

必选

说明

Authorization

Bearer <PAT>

路径参数

参数

类型

必选

说明

file_id

string

文件唯一标识(file_ 前缀)

示例请求

curl -X GET "https://api.qoder.com.cn/api/v1/cloud/files/file_019e3bb8c1387743bf4ef115aae5acb1" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK

{
  "created_at": "2026-05-18T15:33:44Z",
  "file_id": "file_019e3bb8c1387743bf4ef115aae5acb1",
  "filename": "qoder-test-upload.txt",
  "metadata": {},
  "mime_type": "text/plain",
  "purpose": "session_resource",
  "size_bytes": 110,
  "status": "ready",
  "updated_at": "2026-05-18T15:33:44Z"
}

响应字段

字段

类型

说明

file_id

string

文件唯一标识

filename

string

原始文件名

size_bytes

integer

文件大小(字节)

mime_type

string

MIME 类型

purpose

string

文件用途

status

string

文件状态(ready 表示可用)

metadata

object

自定义元数据

created_at

string

创建时间(ISO 8601)

updated_at

string

更新时间(ISO 8601)

错误码

HTTP

type

触发条件

401

authentication_error

缺少或无效的认证令牌

404

not_found_error

指定 ID 的文件不存在

错误响应示例:

{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "File 'file_nonexistent123' was not found."
  }
}

完整错误信封说明详见 错误参考