此代码在“https://www.googleapis.com/auth/drive”范围内运行良好
File folderEntry = drive.files().get("XXXXj0_srDPPGUEtHaVYtZFljMEk").execute();
String driveQuery = "title = '" + "test" + "' and mimeType = 'application/vnd.google-apps.folder' and ";
driveQuery += "'" + folderEntry.getId() + "' in parents";
Files.List request = drive.files().list();
request.setQ(driveQuery);
FileList files = request.execute();
但是,如果我在凭据和 API 客户端访问面板中将范围更改为“https://www.googleapis.com/auth/drive.file”,则会引发错误 500。
500 Internal Server Error { "code" : 500, "errors" : [ {
"domain" : "global",
"message" : "Internal Error",
"reason" : "internalError" } ], "message" : "Internal Error" }
我正在使用服务帐户,父文件夹是由应用程序创建的。
我不明白为什么我不能执行这个查询。