I'm trying to read Google Photos using Drive REST API inside Google Apps Script. The code looks like this:
function myFunction() {
var files = Drive.Files.list({
maxResults: 10,
spaces: 'photos'
});
for (var i = 0; i < files.items.length; i++) {
var f = files.items[i];
Logger.log(f.title);
}
}
But if I run this function Google shows error "The granted scopes do not give access to all of the requested spaces. (line 2, file "Code")"
Project properties contain scope "https://www.googleapis.com/auth/drive" - i.e. all objects should be available. But for some reason I get this error. I think it is a bug in Google Apps Script. Any thoughts?