设置历史版本为最新版本

最近更新时间:2025-10-24 15:25:22

我的收藏

功能描述

用于设置历史版本为最新版本。
说明:
要求权限:admin、space_admin 或 set_history_latest。有关权限详情请参见 生成访问令牌接口

请求

请求示例

POST /api/v1/directory-history/{LibraryId}/{SpaceId}/latest-version/{HistoryId}?access_token={AccessToken}

请求参数

请求参数
描述
类型
是否必选
LibraryId
媒体库 ID,在媒体托管控制台创建媒体库后获取,请参见 创建媒体库
String
SpaceId
空间 ID,如果媒体库为单租户模式,则该参数固定为连字符(-);如果媒体库为多租户模式,则必须指定该参数
String
HistoryId
历史版本 ID ,获取请参见 查询历史版本列表
String
AccessToken
访问令牌,获取请参见 生成访问令牌
String

请求体

该请求无请求体。

响应

响应码

设置成功,返回 HTTP 200 OK。

响应体

application/json
{
"name": "file1.jpg",
"type": "file",
"creationTime": "2020-09-22T07:44:45.000Z",
"modificationTime": "2020-09-22T07:44:45.000Z",
"setLatestTime": "2020-09-22T07:44:45.000Z",
"contentType": "image/jpg",
"size": 1048576,
"eTag": "xxx",
"crc64": "xxx",
"previewByDoc": true,
"previewByCI": true,
"previewAsIcon":true,
"fileType": "powerpoint",
"authorityList": {
"canView": true,
"canPreview": true,
"canDownload": true,
"canPrint": true,
"canUpload": true,
"canDelete": true,
"canModify": true,
"canAuthorize": true,
"canShare": true,
"canPreviewSelf": true,
"canDownloadSelf": true
},
"authorityButtonList": {
"showViewButton": true,
"showPreviewButton": true,
"showDownloadButton": true,
"showUploadButton": true,
"showDeleteButton": true,
"showAuthorizeButton": true,
"showShareButton": true,
"showModifyButton": true,
"showMoveButton": true,
"showRenameButton": true,
"showCopyButton": true,
"showRestoreButton": true
}
}
响应体字段说明:
响应参数
描述
类型
name
文件名
String
type
文件类型
String
creationTime
ISO 8601格式的日期与时间字符串,表示最新版本文件的创建时间,例如2020-10-14T10:17:57953Z
String
modificationTime
ISO 8601格式的日期与时间字符串,表示最新版本文件的修改时间,例如2020-10-14T10:17:57953Z
String
setLatestTime
ISO 8601格式的日期与时间字符串,表示文件被设置为最新版本的时间,例如2020-10-14T10:17:57953Z
String
contentType
媒体类型
String
size
最新版本的文件大小
Int
eTag
文件 eTag
String
crc64
文件的 CRC64-ECMA182 校验值,为了避免数字精度问题,这里为字符串格式
String
previewByDoc
是否可通过 WPS 预览
Boolean
previewByCI
是否可通过万象预览
Boolean
previewAsIcon
是否可用预览图当作 icon
Boolean
fileType
文件类型,例如 Excel、PowerPoint 等
String
authorityList
权限列表
Array
authorityButtonList
按钮权限列表
Array
authorityList包含以下参数:
响应参数
描述
类型
canView
是否可查看
Boolean
canPreview
是否可预览
Boolean
canDownload
是否可下载
Boolean
canPrint
是否可打印
Boolean
canUpload
是否可上传
Boolean
canDelete
是否可删除
Boolean
canModify
是否可编辑
Boolean
canAuthorize
是否可授权
Boolean
canShare
是否可分享
Boolean
canPreviewSelf
是否可自预览
Boolean
canDownloadSelf
是否可自下载
Boolean
authorityButtonList包含以下参数:
响应参数
描述
类型
showViewButton
是否展示查看按钮
Boolean
showPreviewButton
是否展示预览按钮
Boolean
showDownloadButton
是否展示下载按钮
Boolean
showUploadButton
是否展示上传按钮
Boolean
showDeleteButton
是否展示删除按钮
Boolean
showAuthorizeButton
是否展示授权按钮
Boolean
showShareButton
是否展示分享按钮
Boolean
showModifyButton
是否展示编辑按钮
Boolean
showMoveButton
是否展示移动按钮
Boolean
showRenameButton
是否展示重命名按钮
Boolean
showCopyButton
是否展示复制按钮
Boolean
showRestoreButton
是否展示恢复按钮
Boolean

错误码

该请求操作无特殊错误信息,常见的错误信息请参见 错误码 文档。