Dispatch Centre Configuration - Gmail APIs

Dispatch Centre Configuration - Gmail APIs

Purpose

To setup the Gmail API service within the Gmail Admin portal

Access

  1. 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.

A close-up of a screenDescription automatically generated

Complete the Project Name, Organisation and Location for the Project.

Press Create

A notification will display, click on select Project

A screenshot of a notificationDescription automatically generated

In the search bar enter APIS & Services. Select the APIS & Services option.

A red arrow pointing to a yellow squareDescription automatically generated

Enable the Gmail API App

In the menu on the left, select the Enabled APIs and Services option
A screenshot of a computerDescription automatically generated

Select + Enable APIs and Services


Search for Gmail API


A red pencil pointing to a white backgroundDescription automatically generated with medium confidence


Select Gmail API

Enable the App

A screenshot of a google applicationDescription automatically generated

The following will display:

A screenshot of a computerDescription automatically generated

Complete the OAuth Consent Screen

In the menu on the left, select the OAuth consent screen

A screenshot of a computerDescription automatically generated

Check on Internal then Create:

A screenshot of a screenDescription automatically generated

App Information

App Name – Argos Vault

User Support Email – Select the default email address from the Admin login


A screenshot of a computerDescription automatically generated

Authorised Domains

Click + Add Domain

A screen shot of a computerDescription automatically generated

Enter your domain name e.g. argos.co.nz

A blue and white rectangleDescription automatically generated

Developer Contact Information

Enter the email addresses for google notifications regarding the API setups
A close up of a boxDescription automatically generated

Complete the OAuth Scopes:

Select Add or Remove Scopes

A screenshot of a computer screenDescription automatically generated

Search for Gmail API

A screenshot of a computerDescription automatically generated

Select Send email on your behalf – Update

A screenshot of a computer screenDescription automatically generated

Your selection will display here

A screenshot of a emailDescription automatically generated


A Summary Page will display with the setup details.

Complete the Credentials

In the menu on the left, select the Credentials screen

A screenshot of a computerDescription automatically generated

Select the  + Create Credentials option then Service Account


Service Account Details

Enter the Service Account Name as GmailAPIArgosVault

The Service Account ID will automatically populate

A screenshot of a service accountDescription automatically generated

Click Done
A blue square with white lettersDescription automatically generated
Your Service Account is now created:

A screenshot of a computerDescription automatically generated

Create a Private Key

Select the email below to display the Service Account

A screenshot of a computerDescription automatically generated

Go to Keys:

A screenshot of a service accountDescription automatically generated

Add Key

A screenshot of a computerDescription automatically generated

Create New Key

A screenshot of a computerDescription automatically generated

Key Type = JSON, Create

A screenshot of a computerDescription automatically generated

A JSON file will automatically download to you PC. 

A close up of a phone numberDescription automatically generated

Close this dialog

A white rectangular object with black textDescription automatically generated
The Key will display as below:

A screenshot of a computerDescription automatically generated

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

A screenshot of a computerDescription automatically generated

Login to your Admin Workspace, on the side menu go to Security – Access and Data Control – API Controls

A screenshot of a computerDescription automatically generated 

Select Manage Domain-Wide Delegation

A screenshot of a chatDescription automatically generated

Click Add New

A screenshot of a computerDescription automatically generated

Paste in the Client ID copied from the Advanced Settings page and the OAuth Scope - Authorise


A screenshot of a computerDescription automatically generated

A screenshot of a computerDescription automatically generated

Set Permissions

Go to Permissions

A screenshot of a service accountDescription automatically generated

Grant Access

A screenshot of a computerDescription automatically generated

Add Principals

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. 

A screenshot of a web pageDescription automatically generated

Assign Roles

Assign the Server Accounts – Service Account User role to these email addresses

A screenshot of a service accountDescription automatically generated

Save the Permissions

A blue and white square with white textDescription automatically generated

The added email addresses will display as below:

A screenshot of a computerDescription automatically generated

Gmail API Server Setup


A screenshot of a computerDescription automatically generated

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.
  1. 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.
  1. Attempt to email a communication to an address that does not exist.  E.g. doesnotexist@argos.co.nz .  
  1. 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



    • Related Articles

    • Dispatch Centre Configuration - Microsoft Graph

      Purpose Microsoft is moving away from SMTP. Their lastest technology to send email uses Microsoft Graph with Modern Authentication. In order to send email through Microsoft Graph you will need to setup a Microsoft Azure Entra Id application in a ...
    • Dispatch Centre

      Purpose Dispatch Centre allows Communications to be sent by email Concepts Client Contact Points The Client Contact Point contains the client details required for dispatching communications by email. If no Active Client Contact Point record is found, ...
    • Dispatch Centre Errors

      Purpose Resolve any errors that arise during the Communications Dispatch process Access An email will be sent to the Dispatch Centre error notification email address which contains the error message and the internal number of the communication ...
    • Communication Type Details - HTML Email

      Access Communication Types Browse | or | Edit/View Communication Types | or HTML Email The HTML Email text needs to be created as a .html file and saved in a location that all users can access. HTML emails support the following communication ...
    • Send Pending Messages

      Purpose Sends all Communications with a Dispatch Status of 'Ready to Send' via email Access Communications | Invoke Dispatch Centre Communications | Communications Browse | | Communications Browse | Process A welcome message will be presented, click ...