Last active
February 9, 2025 11:47
-
-
Save battis/19a28fe9c378e4b631adbcef7c04b980 to your computer and use it in GitHub Desktop.
List revisions for a Google Drive file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Seth Battis | |
* Google Apps Script | |
* No external dependencies | |
*/ | |
function fileHistory(fileId) { | |
const response = JSON.parse(UrlFetchApp.fetch(`https://www.googleapis.com/drive/v3/files/${fileId}/revisions`, { | |
headers: { | |
Authorization: `Bearer ${ScriptApp.getOAuthToken()}` | |
} | |
})) | |
Logger.log(JSON.stringify(response.revisions, null, 2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment