跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

GET /v1/files/{file_id} 根据文件 ID 获取单个文件的详细元数据信息。

请求头

头部必选说明
AuthorizationBearer <PAT>

路径参数

参数类型必选说明
file_idstring文件唯一标识(file_ 前缀)

示例请求

curl -X GET "https://openapi.qoder.sh/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_idstring文件唯一标识
filenamestring原始文件名
size_bytesinteger文件大小(字节)
mime_typestringMIME 类型
purposestring文件用途
statusstring文件状态(ready 表示可用)
metadataobject自定义元数据
created_atstring创建时间(ISO 8601)
updated_atstring更新时间(ISO 8601)

错误码

HTTPtype触发条件
401authentication_error缺少或无效的认证令牌
404not_found_error指定 ID 的文件不存在
错误响应示例:
{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "File 'file_nonexistent123' was not found."
  }
}
完整错误信封说明详见 错误参考