How to get outlook calendar events for a logged in user without requiring additional login

jayw
ServiceNow Employee
ServiceNow Employee

Hello,

I am interested in getting the logged in user's outlook calendar events via a REST call to this API:
Outlook Calendar REST API reference

https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#all-calendar-api-oper...

Making the REST call is simple, but I am wondering if it would be possible to pass an Okta/JWT token from the first time a user logs in to our instance along to microsoft's Azure AD, which is what authenticates the Outlook Calendar API.

If anyone has advice on accessing the Outlook Calendar REST API from a ServiceNow instance it would be much appreciated! This particular application would essentially be single-tennant I believe, since we would only be looking to access the Outlook Calendars of using within our own AD and instance.

Thanks!

- Jay

3 REPLIES 3

vyjayanth
Giga Expert

Hi Jay, have you been able to accomplish this if so please share how you managed to get the data

 

Thanks

Jay

 

jayw
ServiceNow Employee
ServiceNow Employee

I actually had to put this on the backburner in favor of some nearer term priorities. From what I understand, it would require generating and storing an access token for each user on your instance. I'm digging up some notes, and this was a resource that I had been recommended to check out: https://www.youtube.com/watch?v=8_yHYAPDpvw

Here's another link I had saved about the outlook REST API:

https://msdn.microsoft.com/en-us/office/office365/api/use-outlook-rest-api#ShortRegAuthWorkflow

Each outlook user can potentially access their outlook data from that API, you just need to generate and store their OAuth tokens and create a service portal widget that can use the token to query for the events (and render them to an angular template obviously).

I might end up picking this up again soon, so definitely keep me in the loop if you end up having any luck!

vyjayanth
Giga Expert

thanks Jay, found this helpful to

 

https://www.youtube.com/watch?v=4_Tu3AAerkA