作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Google Apps Scripts 尝试获取 Google 绘图的各种修订版的 exportLinks 列表。下面的代码重现了这个问题。要试用它,请使用绘图 ID 调用 getRevisionHx。
//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
}
最佳答案
已重现相同的结果。
我会为你报告此事。对造成的不便表示歉意。
关于google-apps-script - 如何在 Google Drive API 中获取修订版的导出链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17284278/
我是一名优秀的程序员,十分优秀!