Reference

Endpoint Export a file


Name

export_file

Description

Export a document editor files such document, Spreadsheets, Drawings, Presentations, Apps Scripts to common file formats as defined in this link https://developers.google.com/drive/api/guides/ref-export-formats [API reference]

Parameters

Parameter Required Options
Name: Id

Label: File Id

Id of a file you want to export and file must be editor type (e.g. document, Spreadsheets, Drawings, Presentations, Apps Scripts)
YES
Name: ExportAs

Label: Export As (Mime Type)

The MIME type of the format requested for this export.
YES
Option Value
None
Export to PDF application/pdf
Export to HTML text/html
Export to HTML (zipped) application/zip
Export to Plain text text/plain
Export to Rich text application/rtf
Export to Open Office doc application/vnd.oasis.opendocument.text
Export to MS Word document application/vnd.openxmlformats-officedocument.wordprocessingml.document
Export to EPUB application/epub+zip
Export to MS Excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Export to Open Office sheet application/x-vnd.oasis.opendocument.spreadsheet
Export to (sheet only) text/tab-separated-values
Export to JPEG image/jpeg
Export to PNG image/png
Export to SVG image/svg+xml
Export to MS PowerPoint application/vnd.openxmlformats-officedocument.presentationml.presentation
Export to Open Office presentation application/vnd.oasis.opendocument.presentation
Export to JSON application/vnd.google-apps.script+json
Name: DriveType

Label: Drive Type

Default search context is User's drive. Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive', and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency. By default, corpora is set to 'user'. However, this can change depending on the filter set through the 'Query' parameter.
YES
Option Value
My Drive user
Shared Drive drive
Name: fields

Label: fields

fields
Name: DriveId

Label: Shared DriveId

By default file lists from MyDrive but if you like to search other Shared drive (formally known as Team drive) then set this parameter.
Name: SupportsAllDrives

Label: Supports all drives (e.g. My and Shared)

Whether the requesting application supports both My Drives and shared drives.
Option Value
true true
false false

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Status DT_WSTR nvarchar(4000) 4000
If the column you are looking for is missing, consider customizing Google Drive Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use Google Drive Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Google Drive
Read and write Google Drive data effortlessly. Integrate, manage, and automate files, folders, and shared drives — almost no coding required.
Google Drive
Export a file
Required Parameters
File Id Fill-in the parameter...
Export As (Mime Type) Fill-in the parameter...
Overwrite Mode Fill-in the parameter...
Local File Path Fill-in the parameter...
Optional Parameters
fields True
RequestTimeoutMs 7200000
SaveContentAsBinary True
RawOutputDataRowTemplate {Status:'Downloaded'}
EnableRawOutputModeSingleRow True
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Google Drive
Read and write Google Drive data effortlessly. Integrate, manage, and automate files, folders, and shared drives — almost no coding required.
Google Drive
Export a file
Required Parameters
File Id Fill-in the parameter...
Export As (Mime Type) Fill-in the parameter...
Overwrite Mode Fill-in the parameter...
Local File Path Fill-in the parameter...
Optional Parameters
fields True
RequestTimeoutMs 7200000
SaveContentAsBinary True
RawOutputDataRowTemplate {Status:'Downloaded'}
EnableRawOutputModeSingleRow True
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Export file to another format (e.g., Excel or PDF)

<p>Exports a Google file (e.g. Google Sheets, Docs) to another format and saves it to a local path. Supply the file ID, the target MIME type (<code>ExportAs</code>), and the destination path (<code>ResponseDataFile</code>). For shared drives, add <code>DriveId</code> and <code>DriveType='drive'</code>.</p>

SELECT "Status" FROM export_file
WITH(
	Id='1j0HFOP4gsoE-Zbf2xN3IsPSj8wgwNtIfyyvM1_BWkW4',
	ExportAs='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
	ResponseDataFile='c:\temp\sheet1.xlsx',
	FileOverwriteMode='AlwaysOverwrite'
)

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Export file to another format (e.g., Excel or PDF)

<p>Exports a Google file (e.g. Google Sheets, Docs) to another format and saves it to a local path. Supply the file ID, the target MIME type (<code>ExportAs</code>), and the destination path (<code>ResponseDataFile</code>). For shared drives, add <code>DriveId</code> and <code>DriveType='drive'</code>.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT "Status" FROM export_file
WITH(
	Id=''1j0HFOP4gsoE-Zbf2xN3IsPSj8wgwNtIfyyvM1_BWkW4'',
	ExportAs=''application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'',
	ResponseDataFile=''c:\temp\sheet1.xlsx'',
	FileOverwriteMode=''AlwaysOverwrite''
)';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];