Purpose
To setup the Gmail API service within the Gmail Admin portal
Access
- https://console.cloud.google.com/
Login to the above website.
Create the Project
In the search bar enter Projects. Select the Create a Project option.
Complete the Project Name, Organisation and Location for the Project.
Press Create
A notification will display, click on select Project
In the search bar enter APIS & Services. Select the APIS & Services option.
In the menu on the left, select the Enabled APIs and Services option
Select + Enable APIs and Services
Search for Gmail API
Select Gmail API
Enable the App
The following will display:
Complete the OAuth Consent Screen
In the menu on the left, select the OAuth consent screen
Check on Internal then Create:
App Name – Argos Vault
User Support Email – Select the default email address from the Admin login
Click + Add Domain
Enter your domain name e.g. argos.co.nz
Enter the email addresses for google notifications regarding the API setups
Complete the OAuth Scopes:
Select Add or Remove Scopes
Search for Gmail API
Select Send email on your behalf – Update
Your selection will display here
A Summary Page will display with the setup details.
In the menu on the left, select the Credentials screen
Select the + Create Credentials option then Service Account
Enter the Service Account Name as GmailAPIArgosVault
The Service Account ID will automatically populate
Click Done
Your Service Account is now created:
Select the email below to display the Service Account
Go to Keys:
Add Key
Create New Key
Key Type = JSON, Create
A JSON file will automatically download to you PC.
Close this dialog
The Key will display as below:
This is your private/public key. Keep it safe.
Domain-Wide Delegation Setup
Go to Details – Advanced Settings, Copy the Client ID and select View Google Workspace Admin Console
Login to your Admin Workspace, on the side menu go to Security – Access and Data Control – API Controls
Select Manage Domain-Wide Delegation
Click Add New
Paste in the Client ID copied from the Advanced Settings page and the OAuth Scope - Authorise
Go to Permissions
Grant Access
Emails can be sent out from a different email account, impersonating a sender, that exists under your organization in your Gsuite account.
To do that, you will need to assign it as a Principal User of your service account in your Gmail service.
You will set the emails listed here as the Error email and the Sent From/Reply To email in Vault.
Assign the Server Accounts – Service Account User role to these email addresses
Save the Permissions
The added email addresses will display as below:
Gmail API Server Setup

Gmail API Settings
Field | Explanation |
Email Protocol | Gmail API |
Error Notification Email | Enter the email address that any dispatch centre failed recipient errors should be sent to
A separate email address is to be used for this to make rejections easy to recognise
|
Reply to Address | Enter the email address you want the recipient to reply to
This address shows as the sender in the recipient's email
This may be the same as the Username
|
Service Email | Enter the Service Email from the Service Account Details setup in the Gmail API configuration |
Private Key File Path | [F2] to browse for the folder containing the Private Kay JSON file |
Username | Enter the email address set up as the Principal Email address in the Gmail API configuration |
Important Note: The Email exception errors may be sent to the email account associated with the server username or to the Reply to Address. This will be dependent on the server setup.
Once the dispatch centre control details have been set up you must run the following tests so you know exactly how your errors are being reported.
- Email a communication to an address you have access to that is different from the ones entered above. Check the email is processed correctly and that you receive it.
- Attempt to email a communication to an address that does not exist. E.g. doesnotexist@argos.co.nz .
- Attempt to email a communication without entering an email address.
In the above cases you should receive either the email or an email notifying you of the error.
Service Settings
These settings will determine how often and/or when a check will be made for communications with a status of Ready to Send
Any communications with that status will be dispatched automatically
Field | Explanation |
Scheduled/Manual | Checking this option will allow you to run the dispatch centre manually from within the application or from a Windows Scheduled Task |
Predefined Interval | Check this option if you intend to run the dispatch centre continually as a service. |
Interval (in minutes) | This field is enabled if the Predefined Interval Service Setting has been checked
This indicates the polling interval when dispatch centre is running as a service
The interval entered here is always in minutes, we recommend a setting of 10 minutes
|
Dispatch Centre Path | [F2] to browse for the folder containing the instance of Dispatch Centre required for this database
For example c:\ArgosApps\DispatchCentre
A single instance of Dispatch Centre is required for each different database you run |