My normal, non-admin G Suite users need to work out (programatically) whether they are in a specific G Suite group or not.
Plan A - G Suite Admin SDK
It would appear that one can do that with this call:
https://admin.googleapis.com/admin/directory/v1/groups/developers@example.com/hasMember/max@example.com
This does not work. If I authenticate as an admin, it works. But if I authenticate as max@example.com (note: I added all relevant scopes to token request), I get a 403 "Not Authorized to access this resource/api".
Is it intended that a user cannot query his own group membership via the G Suite Admin SDK?
Plan B - Google People API
I tried this API:
https://people.googleapis.com/v1/people/me?personFields=memberships
This returns a successful 200 response, but the group membership is not in there. The response is something like this, which is basically the standard empty response for that API:
{
"resourceName": "people/107804923746527240895",
"etag": "%EgMBNy4aBEAABQc="
}
Which API call can I make to find out whether I'm in a group or not?