When trying to use AdminDirectory methods I'am getting a:
Project [some number] is not found and cannot be used for API calls.
I've setup a project in the google console and activated the Admin SDK API in both the console and in the script itself.
When doing the same request from here:
https://developers.google.com/admin-sdk/directory/v1/reference/groups/list?authuser=1
I'am not getting an error, but the data is retrieved correctly.
My apps script code block looks as follows (the domain name is changed):
function groupExists(groupId) {
return AdminDirectory.Groups.list({domain: 'my-domain.com'}).groups.some(function(group) {
return group.email === groupId;
});
The same error message appears when I'am using other AdminDirectory methods such as:
var optionalArgs = {
domain: "my-domain.com"
};
var response = AdminDirectory.Users.list(optionalArgs);