2

I have been working on google drive sync mechanism. I am using Google Drive Python SDK for it. The issue i am having is that the google SDK does not return headRevisionId is file resource's metadata if the file is google MimeType i.e it has been created with google docs. Its important for me to store headRevisionId.

Files which are uploaded by user from his local machine does have headRevisionId in its metadata. this issue is for only those google docs.

How do i get headRevisionId of such files. any workaround for this?

Thanks Akif

Juuso Ohtonen
  • 8,826
  • 9
  • 65
  • 98
Akif
  • 21
  • 2

2 Answers2

3

I'm seeing the same behavior, despite messages indicating the issue was addressed: Head revision not working as intended for Google Docs formats.

For now the way I retrieve headRevisionId on a Google Doc is to make a separate call to list revisions (drive.revisions.list) on the fileId.

Details on managing revisions: https://developers.google.com/drive/manage-revisions

Community
  • 1
  • 1
Andy R.
  • 199
  • 2
  • 13
0

According to this page this is how it is currently meant to work.

#head_revision_id ⇒ String

The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
pixelearth
  • 13,674
  • 10
  • 62
  • 110