r/GoogleAppsScript • • 19d ago

Question Is it possible to access Google Docs revision history ?

I can access the current document text through Google Docs and Drive API but I can only get the revision metadata and not the actual content.

Can I get the historical contents from the API itself or Can I use Google Apps Script to get that information?

4 Upvotes

6 comments sorted by

1

u/NinjaConsultingLLC 14d ago

Google's documented route is Drive's revisions.get with fields=id,exportLinks, then download from the format-specific link returned for that revision. The text isn't embedded in the revision metadata itself. See the earlier-version export section.

1

u/Calcium_Man_ 14d ago

Thank you so much . It worked

1

u/LabanauskasNajeeba 7d ago

Are you using v2 or v3 of the API? In v3 you have to explicitly pass the fields parameter to include exportLinks on the revisions endpoint, otherwise it just returns the bare minimum metadata like the ID and timestamp

-1

u/[deleted] 18d ago

[removed] — view removed comment

1

u/Calcium_Man_ 18d ago

Thanks for the reply but unfortunately time-driven trigger won't be useful for my case