文档中心/ 百度搭子/ 企业版使用指南/ API参考/ 文件管理/ 获取文件详情

获取文件详情

GET
https://api.dumate.cn/api/v1/files/{fileId}

本接口用于查询指定文件(File)的元信息,包括文件名、大小、MIME 类型和创建/更新时间等。

权限说明

使用 API Key 鉴权调用 API 流程,具体调用流程,请查看认证鉴权。

请求参数

Headers 参数
除公共头域外,无其它特殊头域
URL 参数
fileId string

待查询的文件标识。

必选
请求结构
GET /api/v1/files/{fileId} HTTP/1.1
Host: api.dumate.cn
Authorization: Bearer <YOUR_API_KEY>

示例代码

请求示例
curl --location --request GET "https://api.dumate.cn/api/v1/files/file-019fff3155d27e38804368dc44a339a5" \
--header 'Authorization: Bearer <YOUR_API_KEY>'

返回响应

Headers 参数
除公共头域外,无其它特殊头域
返回参数
fileID string

文件标识。

可选
name string

文件名称。

可选
size integer

文件大小,单位为字节。

可选
mimeType string

文件 MIME 类型。

可选
createdAt integer

文件创建时间,Unix 秒时间戳。

可选
updatedAt integer

文件更新时间,Unix 秒时间戳。

可选
响应示例
{
    "fileID": "file-01a0156f8f447d228cf854a93d585651",
    "name": "Untitled-1.sh",
    "size": 1818,
    "mimeType": ".sh",
    "createdAt": 1787094828,
    "updatedAt": 1787094828
}