pohogie
pohogie

Reputation: 23

Authenticating Google API Request without headers

I want to redirect to a google api link (Example:

https://www.googleapis.com/drive/v3/files/[File ID]?supportsAllDrives=true&alt=media) 

That will download a file from my drive and as we know you cannot pass headers with redirects for authorization so I'm wondering how else I can authenticate the request.

Upvotes: 0

Views: 135

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116908

You cant send the header like that, only if it was a webContentLink .

If its a binary file then a file.get will give you a webContentLink which you can use to download the file, or you can run a file.export which will allow you to export the file that way.

The only way you can download a file is to be authorized to download the file by the user who owns that file.

Upvotes: 1

Related Questions