Hi Developers,

This is the second article in the three part series for integrating ServiceNow with Google Calendar to schedule a meeting through Virtual Agent.

You need to follow the steps mentioned in the first article to continue with this post.

Step 1) Navigate to System Web Services > Outbound > REST Message and click ‘New’

img-001

Step 2) Give it a unique name

img-002

Step 3) Copy and paste the below URL in the filed ‘Endpoint’

img-003

This information is available on Google Calendar API reference

img-003-a

Step 4) Select the Authentication Type as ‘OAuth 2.0’

img-004

Step 5) Select the ‘OAuth profile’ which got automatically created as a restult of Step 26 in the First article in this series

img-005

When a new OAuth provider is created, the system automatically generates a default profile for it without any scope

img-005-a

Step 6) Make sure the Accessible from value is selceted as ‘All application ccopes’ and click ‘Submit’

img-006

Step 7) Open the record again and from the ‘HTTP Methods’ related list open ‘Default GET’

img-007

Step 8) Fill the form with the information provided below :

Name : Create an Event

HTTP Method : POST

Endpoint : https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events

img-008

Authentication type : OAuth 2.0

OAuth profile : Same as Parent (REST Message)

img-008-a

Content-Type : application/json

img-008-b

Put the below script in the ‘Content’ field’ and click ‘Update’



{
‘summary’: ‘Google I/O 2015’,
‘location’: ‘Online on Meet’,
‘description’: ‘Testing Google Calendar APIs.’,
‘start’: {
‘dateTime’: ‘2020-07-21T09:00:00-07:00’,
‘timeZone’: ‘America/Los_Angeles’
},
‘end’: {
‘dateTime’: ‘2020-07-21T17:00:00-07:00’,
‘timeZone’: ‘America/Los_Angeles’
},
‘recurrence’: [
‘RRULE:FREQ=DAILY;COUNT=2’
],
‘attendees’: [
{’email’: ‘[email protected]’},
{’email’: ‘[email protected]’}
],
‘reminders’: {
‘useDefault’: false,
‘overrides’: [
{‘method’: ’email’, ‘minutes’: 1440},
{‘method’: ‘popup’, ‘minutes’: 10}
] }
}

img-008-c
img-008-d

Step 9) Click on the related link ‘Auto-generate variables’

img-009

Step 10) In the related list ‘Variable Substitutions’ update the record ‘calendarId’ by setting the value to ‘primary’

img-010

Step 11) Click ‘Get OAuth Token’

img-011

Step 12) Select your gmail account

img-012

Step 13 ) Click ‘Advanced’

img-013

Step 14) Click ‘Go to service-now.com (unsafe)

img-014

Step 15) Click ‘Allow’ at each of the below steps to grant permissions

img-015
img-015-a
img-015-b

Congratulations, So far we have built a rest message to schedule a meeting. In the next part we will integrate it with Virtual Agent.

Thank you,

Emergys Blog

Recent Articles

  • Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    In today’s rapidly evolving business landscape, organizations must constantly seek [...]

    In today’s rapidly evolving business landscape, organizations must constantly seek ways to optimize their IT service [...]

  • Credit Unions to Accelerate Growth with Cost-Effective Hyperautomation

    Credit Unions to Accelerate Growth with Cost-Effective Hyperautomation

    Credit unions are grappling with evolving customer expectations, economic uncertainty, [...]

    Credit unions are grappling with evolving customer expectations, economic uncertainty, and growing competition from fintech startups, [...]

  • Unlocking the Power of Data Warehouse Migration

    Unlocking the Power of Data Warehouse Migration

    Unlocking the Power of Data Warehouse Migration