Apps script error: project not found (gsuite)

When trying to use the AdminDirectory methods, I get:

Project [some number] was not found and cannot be used for API calls.

I installed the project in google console and activated the Admin SDK API both in the console and in the script itself.

By doing the same request from here:

https://developers.google.com/admin-sdk/directory/v1/reference/groups/list?authuser=1

I am not getting the error, but the data is being retrieved correctly.

My app block script looks like this (domain name 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 use other AdminDirectory methods such as:

var optionalArgs = {
    domain: "my-domain.com"
};
var response = AdminDirectory.Users.list(optionalArgs);

      

+3


source to share





All Articles