Overview
This is a legacy endpoint. For better performance, we recommend using the new Direct File Download endpoint.
Usage
In order to export/download a file as a specific file type, call our GET /files/{id}/download endpoint with an additional mime_type query parameter. The updated file download endpoint looks as follows:
GET /files/{id}/download?mime_type={type}
To use a concrete example β if you would like to download a Google Document stored in your Google Drive as a word document, you can call the updated file download endpoint as follows:
GET /files/{id}/download?mime_type=docx
Supported Export Formats by Integration
At the moment, Google Drive is the only integration that we support specifying document export formats for.
When specifying the export format in your request, use the mime_type query parameter. The value you pass must be a valid file extension from the Supported mime_type parameter values table below.
To be eligible for export, a document must match one of the exportable file types listed in the Document Type/Source Extension column. If the source file is not exportable, the file download endpoint will return an error stating that the file type cannot be exported. If an invalid mime_type value is provided, the endpoint will return an error indicating that the requested format is not supported.
Google Drive
Document Type | Format | Supported mime_type parameter values |
Google Documents | Microsoft Word | docx |
| OpenDocument | odt |
| Rich Text | rtf |
| ||
| Plain Text | txt |
| Web Page (HTML) | zip |
| EPUB | epub |
Google Spreadsheets | Microsoft Excel | xlsx |
| OpenDocument | ods |
| ||
| Web Page (HTML) | zip |
| Comma Separated Values (first-sheet only) | csv |
| Tab Separated Values (first-sheet only) | tsv |
Google Presentations | Microsoft PowerPoint | pptx |
| ODP | odp |
| ||
| Plain Text | txt |
Google Drawings | ||
| JPEG | jpg |
| PNG | png |
| Scalable Vector Graphics | svg |
Google Drive specific nuances
The exported content is limited to 10MB, see Google API docs.
If an export mime type is not specified, and the file is exportable, then it will be exported as a PDF document by default.
The document requested for export must be one of the following Google Workspace documents: Google Docs (MIME type application/vnd.google-apps.document), Google Sheets (MIME type application/vnd.google-apps.spreadsheet), Google Slides (application/vnd.google-apps.presentation), Google Drawings (MIME type application/vnd.google-apps.drawing).
If the MIME type of the source file is not included in one of the above, the endpoint will raise an exception message stating that the Google Workspace document cannot be exported.