Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Spreadsheet API v4, is it possible to get revision content?

I'm reading through the v4 API and can't satisfy my own question. I want to build an app that gathers a single spreadsheet's previous revision(s). (Specifically, I want to be able to get the entire content of a previous revision.) Is this possible in the v4 API? If it is can I get entire revision snapshots, or does the API only return difference information?

like image 382
yamori Avatar asked Sep 17 '16 15:09

yamori


People also ask

Can you see version history in Google Sheets?

View or revert to earlier versions of Docs, Sheets, and Slides files. Note: You need Owner or Editor access to see the version history. In Drive, open your file. See version history.

Can Google Sheets pull data from an API?

We can connect a Google Sheet to an API and bring data back from that API (e.g. iTunes) into our Google Sheet using Google Apps Script.

How do I get data from another sheet in Google script?

Use the IMPORTRANGE function In Sheets, open a spreadsheet. In an empty cell, enter =IMPORTRANGE. The URL of the spreadsheet in Sheets. The sheet name (optional) and the range of cells to import.


1 Answers

I cannot find any instruction in the Sheets API that can get the revision content of it's file. So the only way to get the revision file is by manually checking it in the Spreadsheet file itself under File -> See revison history. Or by using the Manage Revisions of Google Drive.

Google Drive keeps track of all changes made to a file by automatically creating a "revision history." This allows users to see who made edits and to revert to earlier versions of the same file.

Here are the steps that you need to do in order to get the revision file.

  1. Get the File ID of the Spreadsheet that you want to get its revision.

  2. By using the Revisions: list, you can get here the list of all revision that you do for that file.

  3. Now, by using the Revisions: get, you can now get the specific revision of the file.

For more information, check this SO question.

like image 136
KENdi Avatar answered Sep 30 '22 17:09

KENdi