我正在尝试使用Google Drive File API列出我所有的Google脚本文件,如here所示。但是我总是得到一个空的[]列表。我认为我的令牌和我的范围很好,因为我从Google OAuth2中取回了这个:
{ "access_token": "xxxxx", "expires_in": 3600, "refresh_token": "yyyyy",
"scope": "https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive",
"token_type": "Bearer"
}
但是当我使用mimeType过滤发出查询时(我只想获取谷歌应用程序脚本列表):
mimeType = 'application/vnd.google-apps.script'
即使我刚刚在Google表格中创建了一个谷歌脚本,我也只回到空项目列表([]):
{ "kind": "drive#fileList", "etag": "....", "selfLink": "https://www.googleapis.com/drive/v2/files?q=mimeType+%3D+'application/vnd.google-apps.script'", "incompleteSearch": false, "items": []}
我猜这个应用程序脚本意味着谷歌脚本代码以外的东西,这是Google表格的一部分...任何帮助赞赏:)
关于检索容器绑定脚本类型的项目的文件列表并从项目中导出每个脚本,请检查以下答案。