0

I'm using the javascript client library to try to get a list of users in a domain, but I'm getting a 404 not found in the response.

gapi.client.load('admin', 'directory_v1', function() {
    var request = gapi.client.directory.users.list({ domain: "mydomain.com"});
        request.execute(function(resp) {
            console.log(resp);
    });
});

I have a load function before this that gets the userinfo and that works fine, it's just the directory api I can't get working. I added the admin.directory.user scope, and I have the proper client id and api key. I enabled the Admin SDK in the Services tab of my project. The account that the project was created in has all administrator privileges except super admin. Is there some extra step you have to take to use admin sdk apis? What am I missing?

Any help would be appreciated.

dboss95
  • 1
  • 1
  • Can you confirm that you've enabled API access in the admin console - http://support.google.com/a/bin/answer.py?hl=en&answer=60757 – Arun Nagarajan Jul 15 '13 at 23:41
  • @ArunNagarajan It says "API access is enabled. Any updates you make via this control panel will not transfer to your user management system." Is this the same API access, or do I have to access Security? It doesn't appear on my dashboard. – dboss95 Jul 16 '13 at 13:56

1 Answers1

0

You need to grant Oauth access for ClientId in admin console. Security -> Advanced settings -> Manage Oauth client access And then add your client ID and the scope needed.