This happened earlier with the Google Drive SDK: How do I get exportLinks for revision in the Google Drive API .
My problem is not getting exportLinks - just what the API provided does not work.
Here is a modified version of the "Version Listing" example from the Advanced Drive Service , which registers exportLinks
for each revision of a given fileId
.
function listRevisions(fileId) { var revisions = Drive.Revisions.list(fileId); if (revisions.items && revisions.items.length > 0) { for (var i = 0; i < revisions.items.length; i++) { var revision = revisions.items[i]; var date = new Date(revision.modifiedDate); Logger.log('Date: %s, PDF exportLink: %s', date.toLocaleString(), revision.exportLinks[MimeType.PDF] ); } } else { Logger.log('No revisions found.'); } }
Magazines
Here are sample logs for a test document with two "main" revisions. Version numbers are explicitly specified in exportLinks.
[14-11-13 16:40:50:511 EST] Date: November 13, 2014 4:35:55 PM EST, PDF exportLink: https://docs.google.com/feeds/download/documents/export/Export?id=1V2zkXfyRGh_6gnCXtWlII6sxMQEDcLApRrEk-giIE2s&revision=28&exportFormat=pdf [14-11-13 16:40:50:512 EST] Date: November 13, 2014 4:37:51 PM EST, PDF exportLink: https://docs.google.com/feeds/download/documents/export/Export?id=1V2zkXfyRGh_6gnCXtWlII6sxMQEDcLApRrEk-giIE2s&revision=32&exportFormat=pdf
So far so good. Except that these links open the MOST version of the document ... the last. (Come on, try - the document is open.)
Question: Is there any exportLinks format that really downloads the indicated fixes? (that is, perhaps the “revision” parameter should be called something else)
source share