文件管理

文件属性

属性名
说明
类型

id

图片ID

number

category_id

分类ID

number

title

文件名

string

path

S3 key

string

cover_url

封面完整url

string

file_type

文件大小

number

created_at_gmt

创建时间

string

updated_at_gmt

更新时间

string

url

文件完整url

string

show_size

文件大小展示

string

获取文件列表

GET /openapi/2025-04/files

权限:read_files

Query Parameters

Name
Type
Description

file_name

string

文件名

category_id

string

分类ID

ids

String

文件id串,用,隔开,格式:1,2,3;当设置ids时分类失效

exclude_ids

String

排除的文件id串,用,隔开,格式:1,2,3;

获取文件预授权

POST /openapi/2025-04/files/sign

权限:write_files

Request Body

Name
Type
Description

filename*

String

文件名

mime_type*

String

文件类型

image/jpeg 默认值

image/jpg

image/gif

image/png

image/webp

video/mp4

video/quicktime

resource*

String

资源类型

image 默认值

video

保存文件

POST /openapi/2025-04/files

权限:write_files

Request Body

Name
Type
Description

key

String

S3 Key,由预签名接口下发,当file_content_type为image时必传

file_name

String

文件原始名,用于文件管理展示,当file_content_type为image时必传

mime_type

String

具体类型,当file_content_type为image必传

image/jpeg 默认值

image/jpg

image/gif

image/png

image/webp

video/mp4

video/quicktime

file_content_type*

String

文件类型

image 默认值

external_image 外部图

video 视频

category_id*

number

分类id

url

String

外部文件地址,当file_content_type为external_image时必传

is_hide

String

是否隐藏,1是,0否

获取文件分类列表

GET /openapi/2025-04/file_categories

权限:read_files

Query Parameters

Name
Type
Description

type

String

文件类型,非必传(不传默认全部)

Last updated