Method: files.trash
ファイルをゴミ箱に移動します。現在認証されているユーザーは、ファイルを所有しているか、共有ドライブ ファイルの親の fileOrganizer
以上のユーザーである必要があります。
HTTP リクエスト
POST https://www.googleapis.com/drive/v2/files/{fileId}/trash
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
fileId |
string
ゴミ箱に移動するファイルの ID。
|
クエリ パラメータ
パラメータ |
supportsAllDrives |
boolean
リクエスト元のアプリケーションがマイドライブと共有ドライブの両方をサポートしているかどうかを指定します。
|
supportsTeamDrives (deprecated) |
boolean
非推奨: 代わりに supportsAllDrives を使用してください。
|
includePermissionsForView |
string
レスポンスに含める追加のビューの権限を指定します。published のみがサポートされています。
|
includeLabels |
string
レスポンスの labelInfo 部分に含めるラベルの ID のカンマ区切りのリスト。
|
リクエスト本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功した場合、レスポンスの本文には File
のインスタンスが含まれます。
認可スコープ
次の OAuth スコープのいずれかが必要です。
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.apps.readonly
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 moves a file to the trash, requiring the user to own the file or have sufficient permissions."],["Uses an HTTP POST request with the file ID as a path parameter to specify the target file."],["Allows optional query parameters to control behavior regarding shared drives, permissions, and labels."],["Requires authorization with specific OAuth scopes, including `https://www.googleapis.com/auth/drive` or similar, for access."],["Returns a File resource describing the trashed file upon successful completion."]]],["This content describes how to move a file to the trash using the Google Drive API. The process involves sending a `POST` request to `https://www.googleapis.com/drive/v2/files/{fileId}/trash`, where `fileId` is the file's ID. The request body must be empty, and optional query parameters like `supportsAllDrives` or `includeLabels` can be added. Successful requests return a `File` instance in the response. Authorization requires specific OAuth scopes, such as `https://www.googleapis.com/auth/drive`. The user must own the file.\n"]]