I am writing an automation CLI script code that is reading G Suite user aliases and their Gmail send-as settings. This script cannot have user interaction.
I setup everything with super-admin user account. Setup a service account with the super-admin user and set domain-wide delegation on. And I can list users in domain using Admin SDK API, and I can get Gmail settings of the super-admin user. But if I try to read Gmail settings of other plain user in my domain, it fails with this error.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Delegation denied for [email protected]"
}
],
"code": 403,
"message": "Delegation denied for [email protected]"
}
}
It it allowed to read other users in same G Suite domain email settings using Gmail API? Or is it just always prohibited? What should I do to read their email settings?