3

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);
dgb23
  • 76
  • 1
  • 4
  • As referred [here](http://stackoverflow.com/questions/37469372/google-api-error-400-client-project-not-found), make sure that you have enabled the API in the [Developer console](https://console.developers.google.com/). In the list, find the API you want to use, click on it and Enable it. – abielita Mar 29 '17 at 07:53
  • @abielita I did that as mentioned in the question. – dgb23 Mar 29 '17 at 12:01

0 Answers0