E-mail Robot: Accessing a Mailbox as a Delegate in Google Workspace
To set up a delegate access to the mailbox for the Email Robot through the Google Workspace, complete the following steps:
- Configure Service Connection as mentioned in the Email settings: Gmail Configuration for Google Workspace Service Connection page
-
Create a Service Account in the Google Cloud Console
- Go to the Google Cloud Console.
- Navigate to IAM & Admin → Service Accounts → Create Service Account.
- Assign a name and description.
- Grant roles (optional; for Gmail API, basic access is enough).
- Enable G Suite Domain-wide Delegation:
- Check Enable G Suite Domain-wide Delegation.
- Download the JSON key file.
-
Create and Download JSON Key:
- In the service account details, go to the "Keys" tab
- Click Add Key → Create new key
- Select JSON as the key type
- Click Create
The JSON key file will download automatically
Keep this file secure, as it provides full access to your service account
- Configure Domain-Wide Delegation
- Go to Google Workspace Admin Console → Security → API Controls → Domain-wide Delegation.
- Click Add new:
- Client ID: from your service account JSON file.
-
OAuth Scopes:
https://www.googleapis.com/auth/gmail.settings.sharinghttps://www.googleapis.com/auth/gmail.settings.basichttps://www.googleapis.com/auth/gmail.labelshttps://www.googleapis.com/auth/gmail.modify
- Store JSON Key as System Environment Variable
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your-service-account-key.json" - Proceed with the E-Mail Robot configuration in the Service Desk.