Search code examples
google-admin-sdkgoogle-apis-explorer

Google workspace ADMIN SDK Directory API returns 403


I am trying to access below API (in browser Try this API) and after entering valid group key, I am getting below error message:

API
https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list

RESPONSE

{
  "error": {
    "code": 403,
    "message": "Not Authorized to access this resource/api",
    "errors": [
      {
        "message": "Not Authorized to access this resource/api",
        "domain": "global",
        "reason": "forbidden"
      }
    ]
  }
}


Solution

  • Only domain admins have access to most methods of the Admin SDK

    If you authenticate as a domain user without admin rights or a consumer (Gmail) user, you will get the Not Authorized to access this resource/api error when trying to use the members.list.

    Same applies to most other methods of the Admin SDK with the excepption of the ones that return only publicly accessable information.