Method: files.export
Google Workspace ドキュメントをリクエストされた MIME タイプにエクスポートし、エクスポートされたバイト コンテンツを返します。エクスポートできるコンテンツの上限は 10 MB です。
HTTP リクエスト
GET https://www.googleapis.com/drive/v3/files/{fileId}/export
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
fileId |
string
ファイルの ID。
|
クエリ パラメータ
パラメータ |
mimeType |
string
必須。このエクスポートでリクエストされた形式の MIME タイプ。
|
リクエスト本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功すると、このメソッドはファイルの内容をバイトとして返します。Google Workspace のドキュメントと MIME タイプの変換形式の一覧については、Google Workspace のドキュメントと対応するエクスポート MIME タイプをご覧ください。
認可スコープ
以下のいずれかの OAuth スコープが必要です。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
一部のスコープには制限があり、アプリでそれらを使用するにはセキュリティ評価が必要です。詳細については、承認ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-04 UTC。
[null,null,["最終更新日 2024-09-04 UTC。"],[[["Exports a Google Workspace document to the requested MIME type, returning the file content as bytes with a 10MB size limit."],["Requires providing the file ID as a path parameter and the desired MIME type as a query parameter in the GET request."],["The request body should be empty, and successful responses contain the exported file content in the specified format."],["Authorization is necessary using one of the specified OAuth scopes, some of which may require a security assessment."]]],["This describes exporting Google Workspace documents via a `GET` request to `https://www.googleapis.com/drive/v3/files/{fileId}/export`. The `fileId` is a required path parameter, and `mimeType` is a required query parameter specifying the desired export format. The request body must be empty. A successful response returns the file content as bytes, limited to 10MB. Authorization requires specific OAuth scopes, including `drive`, `drive.file`, `drive.meet.readonly`, or `drive.readonly`.\n"]]