0

I want call this api https://www.googleapis.com/admin/directory/v1/users.

I Have an application from Google Console with creditendials configured. API KEY.

I'am admin of my google gsuite domain.

I call

https://www.googleapis.com/admin/directory/v1/users?domain=xxx-xxx.com&key=xxxxxxxxxxxxxxxxxx

And I have this message

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "required",
                "message": "Login Required",
                "locationType": "header",
                "location": "Authorization"
            }
        ],
        "code": 401,
        "message": "Login Required"
    }
}

I do not understand how it should work.

Polaris
  • 215
  • 1
  • 3
  • 10

1 Answers1

1

Getting all users from G suite is very simple. You have code for list the users from Gsuite in this webpage. Choose your language you are working now on the left side panel. Follow the guide properly. No need to change a single line of code. I have listed all the users from G suite by following java Quickstart.

You can try this also -

  • You can use Google API Explorer
  • Go to this webpage
  • You can find "Try this API" iframe or just press "Try it" button on the right-side panel
  • Refer the page and provide the parameter required.
  • Just provide your domain and orderBy as parameters.
  • It will open a new window and asked for authentication & authorization
  • Once you complete the authorization, users in your Gsuite will be displayed in JSON format.
Satheeshkumar
  • 75
  • 3
  • 12