文档版本概述
版本是基于文件生成的新版本,版本依附于文件而存在。飞书开放平台支持基于在线文档和电子表格创建、删除和获取版本信息。
参数定义
版本相关接口涉及以下通用参数。
| 参数名 | 数据类型 | 描述 |
|---|---|---|
| name | string | 版本文档标题 |
| version | string | 版本文档版本号 |
| parent_token | string | 源文档的 token |
| owner_id | string | 版本文档所有者的 ID |
| creator_id | string | 版本文档创建者的 ID |
| create_time | int | 版本文档的创建时间 |
| update_time | int | 版本文档的更新时间 |
| status | string | 版本文档状态。枚举值有: - StatusExist:正常状态 - StatusDeleted:版本已被彻底删除 - StatusTrash:版本被放入回收站中。默认情况下,删除后的版本将进入版本回收站,30 天后自动彻底删除 |
| obj_type | string | 版本文档的类型。枚举值有: - docx:飞书文档 - sheet:电子表格 |
| parent_type | string | 源文档类型。枚举值有: - docx:飞书文档 - sheet:电子表格 |
方法列表
以下为版本的方法列表。其中,“商店”代表应用商店应用;“自建”代表企业自建应用,了解更多应用相关信息,参考应用类型简介。了解调用服务端 API 的流程,参考流程概述。
| 方法 (API) | 权限要求(满足任一) | 访问凭证 | 商店 | 自建 |
|---|---|---|---|---|
``POST [创建文档版本](https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create) /open-apis/drive/v1/files/:file_token/versions | drive:drive:version 查看、创建、删除文档版本 | tenant_access_token user_access_token | ✓ | ✓ |
``DELETE [删除文档版本](https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete) /open-apis/drive/v1/files/:file_token/versions/:version_id | drive:drive:version 查看、创建、删除文档版本 | tenant_access_token user_access_token | ✓ | ✓ |
``GET [获取文档版本](https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get) /open-apis/drive/v1/files/:file_token/versions/:version_id | drive:drive:version 查看、创建、删除文档版本 drive:drive:version:readonly 查看文档版本 | tenant_access_token user_access_token | ✓ | ✓ |
``GET [获取文档版本列表](https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list) /open-apis/drive/v1/files/:file_token/versions | drive:drive:version 查看、创建、删除文档版本 drive:drive:version:readonly 查看文档版本 | tenant_access_token user_access_token | ✓ | ✓ |
