Method: revisions.delete
永久删除文件版本。对于 Google 云端硬盘中含有二进制内容(例如图片或视频)的文件,您只能删除其修订版本。其他文件(例如 Google 文档或表格)的修订版本以及最后一个文件版本均无法删除。
HTTP 请求
DELETE https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}
网址采用 gRPC 转码语法。
路径参数
参数 |
fileId |
string
文件的 ID。
|
revisionId |
string
修订版本的 ID。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
某些范围受到限制,您的应用必须接受安全评估才能使用这些范围。有关详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-03。
[null,null,["最后更新时间 (UTC):2024-09-03。"],[[["Permanently deletes a specific version of a file in Google Drive, applicable only to files with binary content like images or videos."],["This action is not possible for revisions of Google Docs, Sheets, or the last remaining version of any file."],["Requires authorization with specific scopes such as `https://www.googleapis.com/auth/drive`, `https://www.googleapis.com/auth/drive.appdata`, or `https://www.googleapis.com/auth/drive.file`."],["The request body should be empty and a successful operation results in an empty response body."],["Uses a DELETE request to `https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}` specifying the file and revision IDs as path parameters."]]],["This document outlines the process for permanently deleting a file version in Google Drive. A `DELETE` HTTP request is sent to a specific URL containing `fileId` and `revisionId` path parameters. The request body must be empty. Successful deletion, applicable only to binary content files (e.g., images, videos), results in an empty response body. The operation requires specific OAuth scopes for authorization, including `drive`, `drive.appdata`, or `drive.file`. Revisions for non-binary files or the last remaining version cannot be deleted.\n"]]