0

Google released this blog post which says:

If you authorize download requests to the Drive API using the access token in a query parameter, you will need to migrate your requests to authenticate using an HTTP header instead. Starting January 1, 2020, download calls to files.get, revisions.get and files.export endpoints which authenticate using the access token in the query parameter will no longer be supported, which means you’ll need to update your authentication method.

and then says:

For file downloads, redirect to the webContentLink which will instruct the browser to download the content. If the application wants to display the file to the user, they can simply redirect to the alternateLink in v2 or webViewLink in v3.

however if we use webContentLink then we will hit the 100mb virus page mentioned here.

I can see that the migration has been delayed, however sooner or later this will happen, and we want to future-proof the application.

How will we be able to download content without hitting the 100mb virus limit, after this change is implemented?

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Marcus
  • 675
  • 2
  • 8
  • 24

1 Answers1

2

If you authorize download requests to the Drive API using the access token in a query parameter, you will need to migrate your requests to authenticate using an HTTP header instead.

Example query param:

GET https://www.googleapis.com/drive/v3/files/[FILEID]?access_token=[YOUR_ACCESS_TOKEN] HTTP/1.1
Accept: application/json

Example requests header:

GET https://www.googleapis.com/drive/v3/files/[FILEID] HTTP/1.1

Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json

Assuming that you can do the http header option then you should not have any issues with the download as mentioned. The issues with download only come into play if you cant add the authorization header. In which case i think you would need to go with option number two and export the files directly.

enter image description here

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • 1
    Am I right in saying the previous method allows you to use an API_KEY for our Google Cloud Console account whereas this method only allows you to use an ACCESS_TOKEN which must be authorised by the user and uses access via their approved login? – Marcus Dec 10 '20 at 21:03
  • KEY= api keys still works as a query parm. Access tokens grant authorized access to user data. You are corect. – Linda Lawton - DaImTo Dec 11 '20 at 07:41