Method: files.export
将 Google Workspace 文档导出为请求的 MIME 类型,并返回导出的字节内容。请注意,导出的内容不得超过 10MB。
HTTP 请求
GET https://www.googleapis.com/drive/v3/files/{fileId}/export
网址采用 gRPC 转码语法。
查询参数
参数 |
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 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-04。
[null,null,["最后更新时间 (UTC):2024-09-04。"],[[["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"]]