Method: revisions.delete
ファイルのバージョンを完全に削除します。削除できるのは、Google ドライブ内のバイナリ コンテンツ(画像や動画など)を含むファイルの版のみです。他のファイルの変更履歴(Google ドキュメントやスプレッドシートなど)や、最後に残ったバージョンのファイルは削除できません。
HTTP リクエスト
DELETE https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-03 UTC。
[null,null,["最終更新日 2024-09-03 UTC。"],[[["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"]]