cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Downloading files stored in Google Drive

marenas
New Contributor III

Dear Community,

I have a use case wherein I need to download a file from Google Drive. I followed this guide and the authorization is working fine:

Connecting SaaS providers with SnapLogic's OAuth-enabled REST Snaps | SnapLogic

Then, I configure REST Get snap, add the Query parameter q = title contains โ€˜xyzโ€™ and use https://www.googleapis.com/drive/v2/files/ in the service URL. The snap validates and returns the metadata of xyz file.

My question is, how to download the file? After reading this documentation, I added + $id + โ€˜?alt=mediaโ€™ in the service URL but I got this error below: Rest GET

Can you suggest any solution? If I could not download the file, can you suggest any workaround where I can see the data so that I can write it as a .csv/.xls? Also, I noticed that the snap took longer to validate when I added these in the service URL.

Thanks in advance.

7 REPLIES 7

marenas
New Contributor III

Yes, I also enabled the drive API access and authorize the Google account when I click authorize. see below snapshots:

drive API access

authorize google account

aleung
Contributor III

Were you able to make this work? If so, can you share what you learn?

marenas
New Contributor III

Hi!

Apologize for the delayed response.

Yes, I was able to make this work.

First, set up a Google Service account (it is an AD account with a mailbox attached to it), other team helped us with this part.

Next, I created the Account in SnapLogic of type โ€œSpreadsheet OAuth2 Accountโ€
image

When you click, โ€œAuthorizeโ€, you will be prompted to sign in using the Google Service account.

In Designer, I use the snap โ€œWorksheet Readerโ€ and use the account โ€œSpreadsheet OAuth2 Accountโ€. In the document/spreadsheet that you are going to read data from, please make sure to share that with your Google Service Account.

I hope this helps.