0

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"
      }
    ]
  }
}

Navneet kumar
  • 1,696
  • 1
  • 17
  • 26

1 Answers1

0

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.

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • Thank you for your response, I can not get the admin rights but I am sure I am a valid consumer. do valid consumers have read-only rights? – Navneet kumar Apr 29 '21 at 08:14
  • What do you mean by valid customer? Do you have a (free) consumer or a (paid) Google Workspace account? Consumer accounts are individual, thus there is no Google Workspace domain and consequently no domain admin. Unfortunately the method you are trying to use is only intended for domain admins. – ziganotschka Apr 29 '21 at 08:50
  • we have a paid google workspace and I want to read all the emails inside a google group. – Navneet kumar Apr 29 '21 at 10:31
  • 1
    Then you need to authenticate as an admin or you need to ask the admin of your domain to perform this request for you. Because as mentioned above a non-admin is not authorized to use the method https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list. This is how it is currently implemented by Google. – ziganotschka Apr 29 '21 at 10:59