I’m working on an iPhone app and need to access revision information for Google Drive documents. The tricky part is that my users don’t actually own these documents - they just have access to view them.
What I want to do is pull the revision history and find out when the document was last modified. I don’t need all the detailed revision data, just the timestamp of the most recent change.
Has anyone worked with the Google Drive API on iOS to fetch this kind of metadata? I’m not sure if there are permission restrictions when dealing with documents that belong to other users. Any code examples or guidance would be really helpful.
Same issue here. Permissions are tricky but manageable. Hit the files.get endpoint with fields=“modifiedTime” first - much easier than messing with the revisions API. Just make sure your OAuth scope has drive.readonly at least. Works great for shared docs, though some corporate accounts completely block external apps.
Google Drive API has some limits with files you don’t own, but you can grab basic revision data if you’ve got read access. You need at least read permissions for revision.list - sounds like your users should have that covered. I’ve built this before - use Drive API v3 and hit the revisions endpoint. You’ll get a modifiedTime field for each revision, so just pull the latest one without downloading the full content. Watch out though - document owners can disable revision history in Google Docs, which would block your API access.
Been dealing with this for months. The revision history thing works, but watch out - it breaks when revision tracking is turned off on the document. I’ve had better luck using files.get with fields=“modifiedTime,lastModifyingUser” instead of the revisions endpoint for shared docs. You get what you need without pulling all that revision data. Heads up though - some enterprise Google accounts block modification details for external apps, even with the right scopes. Test with different account types before you push to production.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.