Google Calendar Integration with ServiceNow

Sujatha V M
Kilo Patron
Kilo Patron

Hello Developers & Architects, 

 

As a part of knowledge sharing below is the procedure to integrate Google Calendar with ServiceNow with the error scenarios that I had come across during integration. 

 

Google Calendar Configuration Steps : 

1. Navigate to https://developers.google.com/calendar and click 'Sign in'

Sujatha8_2-1702455110253.png

2. Login with your Gmail credentials (Generic Account for API Enabling)

Sujatha8_3-1702455110255.png

 

3. Navigate to the section 'Reference' and select 'insert' under 'Events' menu options

Sujatha8_4-1702455110259.png

 

4. In new tab, visit https://console.developers.google.com/, Select your country, accept the terms and click 'AGREE AND CONTINUE

 

Sujatha8_5-1702455110264.png

 

5. Click 'Create Project'

Sujatha8_6-1702455110270.png

 

6. Give it a unique name and click 'Create'

Sujatha8_7-1702455110273.png

 

7. Click 'Enable APIs and Services'.

Sujatha8_8-1702455110281.png

 

Sujatha8_9-1702455110283.png

8. Search for calendar and select 'Google Calendar API' and click on “Enable”

 

Sujatha8_21-1702455195577.png

 

9. Select 'Credentials' from menu options

 

Sujatha8_22-1702458181304.png

 

10. Click 'Create Credentials' and select OAuth client ID

 

Sujatha8_23-1702458199031.png

 

11. Configure the consent screen.

 

Sujatha8_24-1702458206246.png

 12. Select the appropriate “User Type” and click on CREATE.

   Note: For testing purpose, “External” user type was selected.

 

Sujatha8_25-1702458223595.png

 

13. Give an App name and User Support email and save it. 

 

Sujatha8_26-1702458237575.png

 

  14. Summary of the OAuth consent screen looks as below,

 

Sujatha8_27-1702458243065.png

 

15. Navigate back to Credentials and select 'OAuth client ID' under 'CREATE CREDENTIALS' and select the application type “Web Application” and give it a unique name.

 

Sujatha8_28-1702458257586.png

 

16. Note down the OAuth 'Client ID' & 'Client Secret' and download the JSON file.

 

Sujatha8_30-1702458568981.png

 

ServiceNow Configuration Steps : 

17.  Login to ServiceNow instance, create an application registry using the generated Client ID and Secret from Google Workspace Project.

 

Sujatha8_1-1702459259304.png

 

18. Add the necessary OAuth Entity Profile and Scopes.

 

Sujatha8_39-1702458955389.png

 

19. Create the REST Message and tag the OAuth profile in “Authentication” tab and necessary headers in HTTP Request.

Sujatha8_2-1702459329570.png

 

Note: Before the connection is established, it displays the information message at the top as “OAuth or Refresh Tokens are not available. Verify the OAuth configuration and click the “Get OAuth Token” link below to request a new token.

 

20. On click of the “Get OAuth Token” link, it prompts for the login credentials used/mentioned during the creation of the project. Sujatha8_32-1702458912899.png

 

Note: Accept/Allow access for all the pop-ups prompted from the Google Project.

 

Sujatha8_33-1702458912901.png

 

21. On successful connection with the Google Workspace, an access token is generated automatically which is generally valid for an hour.

Sujatha8_34-1702458912904.png

 

22. To generate the refresh token, clone the “OAuthUtil” script include and modify the below phrases.

 

Sujatha8_35-1702458912906.png

 

23. Refresh the page or re-login with the same credentials to generate the “Refresh Token”.

 

Sujatha8_36-1702458912910.png

 

-----------------------------------------------------------------------------------------------------------------------------------------

ERROR SCENARIOS

GOOGLE WORKSPACE/CALENDAR

# If Google Service Account is used, it requires access to Google Calendar.

Solution: Access the Google Workspace Admin Portal and make sure that the Google Service Account is in the organizational unit (OU) that has access to the calendar.

 

# If Google Service Account is used, it requires owner permission to the cloud project.

Solution: Access the Google project, go to IAM and give the service account “Owner” permission.

 

# Validate if the Google Service Account can login to Google Workspace and opted as “Internal” type.

 

SERVICENOW

# Non-admin users cannot retrieve OAuth token from OAuth Credentials table to make outbound REST call

Reference: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783632

 

Sujatha8_3-1702459682241.png

 

Solution: Create ACLs as per the support document.

 

# HTTP Error: 401 - Unauthorized

When the user tries to click on the “Get OAuth Link” and it throws the below error.

Sujatha8_4-1702459682243.png

 

Reference: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1430702

 

Sujatha8_5-1702459682247.png

 

Solution: Client secret needs to be entered to obtain the access.

 

# HTTP Error: 403 - Forbidden Username/Password

Reference: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0720934

 

Sujatha8_6-1702459682253.png

 

Sujatha8_7-1702459682256.png

 

Sujatha8_8-1702459682259.png

 

Solution: User - Agent header updated as “ServiceNow” instead of “servicenow”

 

#integration #googlecalendar #servicenowintegration #googleworkspace #happylearning

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.
4 REPLIES 4

kamal_gm
Tera Contributor

Good one, please list out the limitations if any, can we get all features as what we will get in outlook integration?

Thanks @kamal_gm 

 

With regards to Outlook, I'm not aware of the limitations but in Google Calendar. If the Calendar is created for specific set of people to be viewed then Calendar ID and Calendar Permission is must from Google Workspace. 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Prabu Velayutha
Mega Sage
Mega Sage

@Sujatha V M Thanks for sharing and the solutions will be very handy while integrations setup.

Thanks @Prabu Velayutha 👍

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.