![]() Require 'active_support/core_ext/date' # required for timezone calculation gem install activesupport See above for instructions on how to get the download URL by downloading the current version of a document, or use the exportLinks property returned by a get on a File resource using the Drive API (with fields="*" or fields="exportLinks").Īutomating fhackenberger's answer: #!/usr/bin/env ruby As of, with a basic Google account this is the base URL of a download: Īnd this is the corresponding URL for download of a specific revision: Note that the base URL to which the revision is appended will vary over time, and may vary depending on the Google Workspace you're using. Where XXXX is the fileId and NNN is your revision number.Ĭomments below indicate people are having trouble with this solution, but it works in Jan 2022 with an updated URL. The final URL should look something like this: /document/u/0/d/XXXX/export?format=docx&revision=NNN Then use that number to download your document. Scroll down to the response, look at the modifiedTime and choose the correct number from the id field. Paste that into the fileId on the API explorer page an hit Authorize and execute. It's also visible in the download URL you copied before. In order to do that, visit revisions list and click on Try it now, then enter the fileId of your document, which is the long string of characters and numbers between /document/d/ and the next slash in your browsers URL bar when editing the document. So the only exercise left is finding out which revision ID you need to use. Then simply append &revision=NNN and paste this new URL into your browser address bar and hit enter. If you download the current version of your document, right-click on the download in the Downloads window of your browser (Firefox) and copy the URL.
0 Comments
Leave a Reply. |