lollah mullah
lollah mullah

Reputation: 13

Google Drive API get revisions

I am trying to get a file (non google format - Excel file) through the google API by calling a GET requests against the API by passing the file Id and the revision Id.

In the response, I see the selfURL and downloadURL both of which are not working.

I'm getting an error (it needs authentication when trying to download - I am using free account, not paid one) and if I paste in the browser, it's not getting anything.

Any idea how I can download the file?

Upvotes: 0

Views: 490

Answers (1)

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17613

Here's how to get your xlsx (Excel) revision file:

Step 1. You have to know which revisionId, you want to download. You can check list of revision ids by entering fileId in the revision: list 'Try it'. Authorize and Execute.

Step 2. Go to revisions: get Try it enter image description here

If the response is 200, OK,check the reponse body. Use the exportLink ending in &exportFormat=xlsx for xlsx:

 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:

https://docs.google.com/spreadsheets/export?id={FILE_ID}&revision=6&exportFormat=xlsx

Click that and it will download the file.Hope it helps.

Upvotes: 1

Related Questions