6

I am using Google Apps Scripts to attempt to get a list of exportLinks for the various revisions of a Google Drawing. The code below reproduces the problem. To try it out, call getRevisionHx with the ID of a drawing.

//Google oAuth
function googleOAuth_(name,scope) {
  var oAuthConfig = UrlFetchApp.addOAuthService(name);
  oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
      oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
  oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
  oAuthConfig.setConsumerKey("anonymous");
  oAuthConfig.setConsumerSecret("anonymous");
  return {oAuthServiceName:name, oAuthUseToken:"always"};
}

function getRevisionHx(resource_id){
  var scope = 'https://www.googleapis.com/auth/drive';
  var myKey = KEY_DELETED_FROM_SAMPLE_CODE;

  var fetchArgs = googleOAuth_('drive', scope);
  fetchArgs.method = 'GET';

  var url = "https://www.googleapis.com/drive/v2/files/" + resource_id + "/revisions?key=" + myKey;
  var urlFetch = UrlFetchApp.fetch(url, fetchArgs);

... //snip

}

At the snip, the urlFetch has succeeded and it has a list of revisions with exportLinks for each of them. If I grab one of those exportLinks and download it using a web browser, it always retrieves the latest version of the document, not the specified revision. Is this a bug or am I doing something wrong?

In other words, all of the above code seems to work fine (the API call succeeds and returns what is expected), but the exportLink URLs returned don't point to the revision they say they will.

TorgoGuy
  • 1,316
  • 1
  • 9
  • 10

1 Answers1

0

Same result has been reproduced.

I will report this for you. Sorry for inconvenience.

JunYoung Gwak
  • 2,967
  • 3
  • 21
  • 35
  • More than a year later, this is still broken. The revision id seems to be ignored in all the export Links. Any update, @JunYoungGwak? – Mogsdad Nov 13 '14 at 21:58
  • I'm sorry I do not work for Google anymore. I cannot provide support for this issue. – JunYoung Gwak Nov 14 '14 at 06:46