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,

Related Posts

  • Best Practices for 2023 ServiceNow ITAM

    Best Practices for 2023 ServiceNow IT Asset Management (ITAM)

    Best Practices for 2023 ServiceNow IT Asset Management (ITAM)

    Technology has become so pervasive in business operations that it [...]

  • Why does your business need ServiceNow ITAM

    Why does your business need ServiceNow ITAM

    Why does your business need ServiceNow ITAM

    Reduced administrative expenses, streamlined services, and increased customer satisfaction are [...]

  • ServiceNow CMDB Boost Your Company Growth

    ServiceNow CMDB: Boost Your Company’s Growth

    ServiceNow CMDB: Boost Your Company’s Growth

    Even under ideal circumstances, operating and maintaining a reliable configuration [...]

Emergys Blog

Recent Articles

  • Large Language Models

    Verticalization of Large Language Models (LLMs): Unlocking Specialized Potential with Emergys

    Verticalization of Large Language Models (LLMs): Unlocking Specialized Potential with Emergys

    Large Language models (LLMs) have transformed Natural Language Processing [...]

    Large Language models (LLMs) have transformed Natural Language Processing (NLP); however, their generalist nature can [...]

  • 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 [...]

  • Service Desk Automation

    Top Candidates for Service Desk Automation

    Top Candidates for Service Desk Automation

    Automation is not new to anyone. It is the foundation [...]

    Automation is not new to anyone. It is the foundation for any enterprise digitization. However, companies [...]