08-14-2021 06:03 PM
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:
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.
08-24-2021 11:04 AM
Yes, I also enabled the drive API access and authorize the Google account when I click authorize. see below snapshots:
12-05-2022 05:57 PM
Were you able to make this work? If so, can you share what you learn?
12-06-2022 08:14 AM
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”
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.