Method: files.untrash
ゴミ箱からファイルを復元します。現在認証されているユーザーは、ファイルを所有しているか、共有ドライブ ファイルの親の fileOrganizer
以上のユーザーである必要があります。
HTTP リクエスト
POST https://www.googleapis.com/drive/v2/files/{fileId}/untrash
この 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-05 UTC。
[null,null,["最終更新日 2024-09-05 UTC。"],[[["Restores a file from the trash, requiring the user to be the owner or a fileOrganizer."],["Uses an HTTP POST request to the endpoint `https://www.googleapis.com/drive/v2/files/{fileId}/untrash` with the file ID as a path parameter."],["Accepts optional query parameters to support various drives and include additional information in the response."],["Returns the restored file details in the response body if successful, requiring specific authorization scopes for access."]]],["This document outlines the process for restoring a file from the trash using the Google Drive API. The key action is to send a `POST` request to `https://www.googleapis.com/drive/v2/files/{fileId}/untrash`, where `fileId` identifies the file. The request body must be empty, but it can include `supportsAllDrives`, `includePermissionsForView`, and `includeLabels` as query parameters. Authorization requires specific OAuth scopes. A successful response returns a `File` object. The authenticated user must be the file's owner.\n"]]