I'm trying to use rest to list the members of a google workspace group via the rest api. Steps:
- Created a service account
- Delegated the scope https://www.googleapis.com/auth/admin.directory.group.readonly
- Used the private key to generate an OAuth2 token
- curl -v -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" https://admin.googleapis.com/admin/directory/v1/groups\?userKey\=user@my-domain.com\&maxResults\=20
But I always get the same response:
{
"error": {
"code": 404,
"message": "Domain not found.",
"errors": [
{
"message": "Domain not found.",
"domain": "global",
"reason": "notFound"
}
]
}
}
What am I missing?