Just like the title says, I'm trying to find a way to restore a spreadsheet to a specific version using the Google Sheets API v4 (or Google Drive API v3).
This is needed because of unit testing - I need one test to perform some actions (let's say delete a row) on a spreadsheet, assert the results and then reset the spreadsheet to its initial state so the next test can execute on the original spreadsheet.
So far I noticed that there isn't an option to do something similar in the Google Sheets API. As far as using the Google Drive API goes, I tried using revisions (getting a list of all revisions and deleting all revisions after the desired one), but to no avail.
I also tried capturing the request after clicking on the Restore this version button and found out there is a revisions/revert
endpoint.
> Example:
> https://docs.google.com/spreadsheets/d/**spreadsheetId**/revisions/revert?includes_info_params=false
I actually managed to revert the version this way, but using Postman and using hardcoded values - which is bad.
Any advice on how to approach this?