M365 : Microsoft Graph – Getting all events happening in specific meeting room from outlook calendar

M365 - Microsoft Graph - Event created in Outlook calendar
M365 - Microsoft Graph - Event created in Outlook calendar

Hi All,

Today new short learning 🙂

On one of the Facebook SharePoint group one friend asked the question related to Microsoft Graph – “Whether it is possible to get all events from a given room?”

I was sure that it is possible but never tried before so thought to explore. It took me couple of time and then thought to share to save the time of all of us. Next time no need to reinvent the wheel 🙂

Let’s begin the fun 🙂

I logged in to my local tenant and wen to Outlook calendar (https://outlook.office.com/calendar/view/month ). I created two events with room names “Dr. APJ Abdul Kalam” and “Aryabhata” as shown in below fig1 and fig2 (My most favorite personalities names :))

M365 - Microsoft Graph - Event created in Outlook calendar with room name  "Dr. APJ Abdul Kalam"

Fig1: M365 – Microsoft Graph – Event created in Outlook calendar with room name “Dr. APJ Abdul Kalam”

M365 - Microsoft Graph - Event created in Outlook calendar with room name  "Aryabhata"

Fig2: M365 – Microsoft Graph – Event created in Outlook calendar with room name “Aryabhata”

Note: Here, I have given directly  room names rather create tenant level room list in Outlook and using those rooms. In references section added the references for room lists.

I started graph explorer and exploring with the queries.

  • Get all my events – https://graph.microsoft.com/v1.0/me/events – This returns me above both the events with all the properties. Event has lots of default properties but following are important ones:
    • id  – Id of specific event
    • createdDateTime
    • lastModifiedDateTime
    • categories
    • reminderMinutesBeforeStart
    • isReminderOn
    • hasAttachments
    • subject
    • bodyPreview – Description of the event
    • isAllDay
    • isCancelled
    • showAs – Busy, Free etc
    • webLink – URL of the Outlook calendar
    • recurrence
    • start
    • end
    • location
    • attendees
    • organizer
  • Get all my events with selected properties : https://graph.microsoft.com/v1.0/me/events?select = subject, bodypreview, start, end, location  => following json is returned (location node is marked in bold):

“value”: [{
“@odata.etag”: “W/\”rxjQLVfXd0OlqBCmT5XUtwAACw4r/Q==\””,
“id”: “AAMkAGIzMmZhZjViLWU0MGUtNDFkYS1iZmIyLTc4MGExOWRkMGE5ZgBGAAAAAADfysVlsA1wSIZ_piKxgb8EBwCvGNAtV9d3Q6WoEKZPldS3AAAAAAENAACvGNAtV9d3Q6WoEKZPldS3AAALEQgeAAA=”,
“subject”: “O365 bootcam Session1 in Track1 – PowerPlatform”,
“bodyPreview”: “Lets discuss PowerPlatform – PowerBI + PowerApps + Flow”,
“start”: {
“dateTime”: “2019-09-29T00:00:00.0000000”,
“timeZone”: “UTC”
},
“end”: {
“dateTime”: “2019-09-30T00:00:00.0000000”,
“timeZone”: “UTC”
},
“location”: {
“displayName”: “Dr. APJ Abdul Kalam”,
“locationType”: “default”,
“uniqueId”: “Dr. APJ Abdul Kalam”,
“uniqueIdType”: “private”
}
},

{
“@odata.etag”: “W/\”rxjQLVfXd0OlqBCmT5XUtwAACw4rrA==\””,
“id”: “AAMkAGIzMmZhZjViLWU0MGUtNDFkYS1iZmIyLTc4MGExOWRkMGE5ZgBGAAAAAADfysVlsA1wSIZ_piKxgb8EBwCvGNAtV9d3Q6WoEKZPldS3AAAAAAENAACvGNAtV9d3Q6WoEKZPldS3AAALEQgdAAA=”,
“subject”: “O365 bootcamp session1 – Microsoft Graph”,
“bodyPreview”: “Lets discuss Microsoft Graph in depth”,
“start”: {
“dateTime”: “2019-09-29T00:00:00.0000000”,
“timeZone”: “UTC”
},
“end”: {
“dateTime”: “2019-09-30T00:00:00.0000000”,
“timeZone”: “UTC”
},
“location”: {
“displayName”: “Aryabhata”,
“locationType”: “default”,
“uniqueId”: “Aryabhata”,
“uniqueIdType”: “private”
}
}
]
}

{
“@odata.context”: “https://graph.microsoft.com/v1.0/$metadata#users(‘ff594132-b1a6-4bd3-92e5-1d4621ca9180’)/events(subject,location)”,
“value”: [
{
“@odata.etag”: “W/\”rxjQLVfXd0OlqBCmT5XUtwAACw4rrA==\””,
“id”: “AAMkAGIzMmZhZjViLWU0MGUtNDFkYS1iZmIyLTc4MGExOWRkMGE5ZgBGAAAAAADfysVlsA1wSIZ_piKxgb8EBwCvGNAtV9d3Q6WoEKZPldS3AAAAAAENAACvGNAtV9d3Q6WoEKZPldS3AAALEQgdAAA=”,
“subject”: “O365 bootcamp session1 – Microsoft Graph”,
“location”: {
“displayName”: “Aryabhata”,
“locationType”: “default”,
“uniqueId”: “Aryabhata”,
“uniqueIdType”: “private”
}
}
]
}

I hope this will help to understand the event queries. I would say try yourself more different queries, graph explorer is very powerful tool.

References:

  1. Office 365 – Microsoft Graph and Graph Explorer
  2. Creating room lists in Outlook
  3. Resources and Room Lists
  4. Configuring Room Finder in Office 365 using Room list
  5. Use query parameters to customize responses
  6. event resource type

Thanks for reading 🙂

Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more.

If you have any suggestion / feedback / doubt, you are most welcome.

Stay tuned on Knowledge-Junction, will come up with more such articles.

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

2 Responses

  1. Dan says:

    Are you getting all YOUR events of the room or ALL events of the room. I think with this call will only see your room events, right?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading