
HaloCRM Guides
Google Calendar Integration
In this guide we will cover:
- Key Details
- Google Configuration
- Halo Configuration
- Depreciated Method
The Google Calendar integration can be used to link agent calendars within Halo to their Google calendar. This allows you to import appointment from Google calendars into Halo.
Key Details
The new API Method dropdown for the Google Calendar integration uses the read and write capabilities of a service account in order to pull in appointments/ recurring appointments from Agent's calendars. This can be set on a recurring schedule via the Halo Integrator. The NHServer method is depreciated and should not be used.
Service accounts: If you are building an application that needs to access Google Calendar data on behalf of your own application rather than individual users, you can use service accounts. With service accounts, you can authenticate your application using a private key file instead of user credentials. This service account setup is required for the Halo Integrator connection type.
Google Configuration
Project Setup
Navigate to the Google Cloud Console https://console.cloud.google.com/, and create a new project.
Fig 1. Google Cloud Console.
Select the new project.
Fig 2. Selecting the new project.
Enable the Google Calendar API.
Fig 3. Google calendar API
Fig 4. Enabling the API.
Now you will need to create credentials for a service account. To do this, first click on "Create Credentials" in the Google Calendar API area.
Fig 5. Create credentials.
Then you will prompted to choose which credential type to use, choose the Application Data option (this will prompt you to create a service account).
Fig 6. Application data credential type
Fig 7. Creating a service account.
Add in the role "Service Account Token Creator".
Fig 8. Adding the role.
Then save the account.
Now head to menu > IAM and Admin > service accounts > select the service account you have just created. Here, you will see the details of this account. Copy the email address of this service account.
Fig 9. Service accounts menu.
Now you will need to share the calendar with the service account. As a service account doesn’t have calendar, we must share the actual user calendar with the service account to send an event. Navigate to an actual user account email calendar, find a calendar in the bottom left you would like to share > hover over it and click the three dot menu > settings and sharing . Here, scroll to the 'shared with' section and add people and groups. Enter the email ID of the service account you created. Ensure this is shared with the permission 'Make changes to events'.
Fig 10. Add people and groups.
Add in the service account email address.
Fig 11. Adding the email.
IMPORTANT: The Agent's calendar that you are connecting to, must correspond to the email address of an admin agent in Halo, without this the calendar will not connect.
Enable Domain Wide delegation
Domain-wide delegation requires Google Workspace admin credentials to enable. It is required for the Google Calendar API because it allows a service account, which is an account representing an application rather than an individual user, to access the resources of a user within a G Suite domain.
By using domain-wide delegation, the service account can act on behalf of users within the domain and access their calendars. This is crucial in scenarios where an application needs to manage and interact with calendars of multiple users within an organization.
Navigate to https://admin.google.com/ and login with admin credentials. Go to Security > Access and Data Control > API Controls > Domain-wide Delegation > MANAGE DOMAIN WIDE DELEGATION.
Fig 12. API Controls menu.
Add a new Client by clicking "Add new". Get client ID from service account. Unique ID available under the service account
Add all the below scopes by copying and pasting and then authorize:
- https://www.googleapis.com/auth/calendar
- https://www.googleapis.com/auth/calendar.events
- https://www.googleapis.com/auth/admin.directory.resource.calendar
- https://www.googleapis.com/auth/userinfo.profile
- https://www.googleapis.com/auth/userinfo.email
Fig 13. Adding a client ID.
Once you have added all the scopes hit 'authorise'.
Generate Service account Key
Head back to the Google cloud console and add a Key to the Service Account. IAM & Admin > Service Accounts > *your service account* > Keys tab.
Fig 14. Add key to service account
Choose JSON as the key type.
Fig 14. Creating a private key.
It will download the JSON file with the Service Account Private Key and other details.
Grab the JSON from the file which has been downloaded (this can be viewed in a notepad) (this may be easier to view in a code editor such as vs code). Your JSON will look something like below:
{
"type": "service_account",
"project_id": "xxx-1231",
"private_key_id": "xxx",
"private_key": "xxx",
"client_email": "test.iam.gserviceaccount.com",
"client_id": "xxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
Halo Configuration
Head into Halo, go to configuration > integrations > google calendars, enable the module using the '+' icon.
Fig 15. Enable integration module
Here, choose the API Method to be 'Halo integrator'. Then paste the JSON we just obtained into the 'Google Service User JSON' field.
Fig 16. Adding the JSON and API method.
Once pasted, hit 'Sign in with Google' to connect. Once connected additional configuration options will appear.
Fig 17. Configuration after connecting
To check which agents calendars are accessible hit 'Update Calendar access', this will provide a list of all connected agents.
Note: Agents will only show here if the email against their agent account matches the email against their google account (used for calendars). If the emails do not match they will not show in the list here but appointments will still be imported as the service account still has access to all calendars in the directory.
Now you will have the connection to Google and all connected calendars will pull through to Halo. You can connect the Halo Integrator to the calendar so that appointments are pulled through on a recurring schedule.
Fig 18. Enabling the Halo integrator.
Appointments and recurring appointments can also be imported manually using the 'Import Appointments' and 'Import Recurring Appointments' buttons.
Fig 19. Importing appointments.
If appointments are out of the agents working hours, you will be given a popup not during the import: "Done - Please note that part or all of this Appointment falls outside the Agents working hours."
You will then see the imported appointments on the agents calendar.
Fig 20. Imported appointments.
Deprecated Method
General Configuration
To enable the Google Calendar integration in Halo, go to Configuration > Integrations > Communications, and enable the module. Once the module has been enabled, click the menu icon for the module to begin configuring it.
Setting up a Google Calendar App
Login to https://console.cloud.google.com
Select New Project from the Select a Project menu or Create Project from the Dashboard.
Fig 21. Selecting a project.
Give the project a name and create it. Search for and select API and Services.
Fig 22. Finding the API and Services area.
Select Enable APIS and Services.
Fig 23. Enabling API and services.
Search for Google Calendar API and enable the API for use.
Fig 24. Enabling the API.
Go to OAuth consent screen.
Workspace user client setup
- Select internal.
- Add email information.
- Click save and continue
- Click add scope.
- Add Google calendar API scope.
Non-workspace user client setup
- Select external.
- Add email information.
- Click save and continue
- Click add scope.
- Add Google calendar API scope.
Because this is an external app you will now need to add all mailboxes which you want to be accessed into the Test Users section
Create Credentials
- Go to credentials.
- Click Create Credentials
- Select OAuth client ID.
- Select Web Application for the application type and enter "https://auth.haloservicedesk.com/externalauth" (change this depending on the version of Halo you are using, i.e. if using HaloITSM rather than HaloServiceDesk, use link "https://auth.haloitsm.com/externalauth") as the authorised redirect URI.
- Once created copy the Client ID and Client secret. These will be needed when setting up the Web App connection.
Setting up in Halo
Connect to Google.
- Go to Config > Integrations > Google Calendars.
- Add the client id copied from the previous step
- Add the client secret copied from the previous step.
- Click Sign In With Google to authorise access to the app.
Fig 24. Connecting to Google.
Once completed you should be redirected back to the Google calendar integration setup screen. If the authorisation was successful the Sign In button will have changed to a disconnect button.
Fig 25. Successful connection.
Agent calendars
Use the check calendars option to confirm which of your technicians calendars are accessible via your connected account. When clicked, a list of all technicians calendars that are accessible will be displayed. If you cannot access any technician calendars, you will be notified of this.*
On-Premise Customers using NHServer
If you have your own on premise version of Halo and are using NHServer to process mail, please contact the Halo support team for assistance enabling the appointment sync in NHServer. You must be using NHServer version 13.18.01 or above for this feature to work.
Note: For the authorizing account, ensure that the account has shared access such that it can read and create calendar entries in the individual agents accounts from within Google. This can be configured from within Google Calendars itself, where you define shared calendar access between agent accounts. The authorizing account will also need to 'subscribe' to each of the agent's calendars, so they they appear in the list of selectable calendars on the left, when the authorizing account views their calendar. Case will also need to be matched between the Gmail email address and the Halo agent email address (usually all lowercase).
Popular Guides
- Asset Import - CSV/XLS/Spreadsheet Method
- Call Management in Halo
- Creating a New Application for API Connections
- Creating Agents and Editing Agent Details
- Departments and Teams
- Halo Integrator
- Importing Data
- Multiple New Portals with different branding for one customer [Hosted]
- NHServer Deprecation User Guide
- Organisation Basics
- Organising Teams of Agents
- Step-by-Step Configuration Walk Through