Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Admin Directory users.list request returns 400 Bad request

This happens in the API Explorer and using the .NET client API. In the API Explorer, I was trying to use the query param, but eventually I just removed it and now send the request with no params, and it still turns around 400 even though I am authenticating successfully with OAuth2 in browser.

Why is this endpoint broken?

https://developers.google.com/admin-sdk/directory/v1/reference/users/list

like image 655
zenocon Avatar asked Jul 24 '26 18:07

zenocon


2 Answers

The problem was the customer field was not filled in. It must contain a valid customer id. Once I populated that, it worked.

Really wish Google would work on providing better error feedback and improve their docs. This field (as of today) is still listed as optional.

like image 192
zenocon Avatar answered Jul 27 '26 03:07

zenocon


As the documentation says:

either the customer or the domain parameter must be provided

I tried to specify domain name and it worked.

like image 45
Tyler Liu Avatar answered Jul 27 '26 04:07

Tyler Liu