ODBC guide

Download a file


Downloads a file. Identify the file by ID or path and specify the local target path in the WITH clause. To convert to PDF or HTML, use the download_file endpoint with ConvertTo and TargetFilePath.

SELECT * FROM download_file
WITH (
      DriveId='me'
   --OR-- Use Shared Drive Id or other User's Drive Id
   --,DriveId='b!GtLN726LE0eXXXXXXXXXXXX'

   --Enter file path (on root or under subfolder)
   --,FileId='root:/dump.pdf:'	--Path must end with colon
   --,FileId='root:/myfolder/dump.pdf:'
   --OR-- 
   --,FileId='01SUOJPKHXMPKD2UXXXXXXXXXXXXXXXXXX'
   
   ,TargetFilePath='C:\My files\Employees\List.xlsx'
   )
   --DriveId can be retrieved by selecting from 'list_drives' endpoint.
   --FileId can be retrieved by selecting from 'list_files' endpoint.