【发布时间】:2020-09-03 05:33:18
【问题描述】:
我需要将幻灯片文件发布到网站并获取发布的 URL,但我没有将发布的 URL 作为返回响应。
云端硬盘服务已开启。
我试过了
function doGet(e) {
var ppt = SlidesApp.openByUrl('https://docs.google.com/presentation/d/1fIQpQJ8QaIqt3fibTGmlAndZuvDG3ry8maAm_0CgSLE/edit#slide=id.p');
var fileId = ppt.getId();
var revisions = Drive.Revisions.list(fileId);
var items = revisions.items;
var revisionId =items[items.length-1].id;
var resource = Drive.Revisions.get(fileId, revisionId);
resource.publishAuto = true;
resource.publishedOutsideDomain = true;
resource.published = true;
return ContentService.createTextOutput(JSON.stringify(Drive.Revisions.update(resource, fileId, revisionId).publishedLink));
}
【问题讨论】:
-
调试细节?日志?时间戳相关?查看> 处决?
-
如果我使用上面的代码,它的空白输出
-
我如何获得发布链接?
-
Edit 显示
console.log(JSON.stringify(Drive.Revisions.update(resource, fileId, revisionId).publishedLink)))的输出 -
我看到json根本没有这个属性。但文件说它有。希望你能复制这个问题吗?
标签: google-apps-script google-drive-api google-slides-api google-slides