Method: parents.insert
HTTP リクエスト
POST https://www.googleapis.com/drive/v2/files/{fileId}/parents
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
fileId |
string
ファイルの ID。
|
クエリ パラメータ
パラメータ |
enforceSingleParent (deprecated) |
boolean
非推奨: 複数のフォルダにファイルを追加することはサポートされなくなりました。shortcuts を代わりに使用してください。
|
supportsAllDrives |
boolean
リクエスト元のアプリケーションがマイドライブと共有ドライブの両方をサポートしているかどうかを指定します。
|
supportsTeamDrives (deprecated) |
boolean
非推奨: 代わりに supportsAllDrives を使用してください。
|
リクエスト本文
リクエストの本文には ParentReference
のインスタンスが含まれています。
レスポンスの本文
成功した場合、レスポンスの本文には、新しく作成された ParentReference
のインスタンスが含まれます。
認可スコープ
次の 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.file
一部のスコープは制限されているため、アプリで使用するにはセキュリティ評価が必要です。詳細については、承認ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-03 UTC。
[null,null,["最終更新日 2024-09-03 UTC。"],[[["This endpoint allows you to add a parent folder to a specified file using its `fileId`."],["The request requires a `ParentReference` in the body and may include optional query parameters like `supportsAllDrives`."],["Upon success, the response returns a newly created `ParentReference` object."],["Authorization is necessary using one of the provided OAuth scopes, some of which require a security assessment for app usage."]]],["This API endpoint uses a POST request to add a parent folder to a file specified by its `fileId` via a path parameter. The URL employs gRPC Transcoding. Optional query parameters, including `enforceSingleParent`, `supportsAllDrives`, and `supportsTeamDrives` allow modifications of the request. The request and response body both utilize the `ParentReference` instance. Authorization necessitates one of the listed OAuth scopes.\n"]]