Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get exportLinks for revisions in Google Drive API
    primarykey
    data
    text
    <p>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.</p> <pre><code>//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 } </code></pre> <p>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 <em>always</em> retrieves the latest version of the document, not the specified revision. Is this a bug or am I doing something wrong?</p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload