Microsoft Graph - Unable to fetch Microsoft exchange room capacity

89 Views Asked by At

As stated above I am currently unable to fetch the room capacity per room in Microsoft Exchange.

Below is part of my code that displays the room id, displayName, start time and end time. But no matter where I search the room capacity property is nowhere to see.

    const data = calendarEvent.map((event: microsoftgraph.Event) => {
        return {
            id: event.id,
            title: event.location.displayName,
            capacity: event.location.roomCapacity, //(I know this isn't a real graph property) But in theory this is what I am trying to, but I am unable to find a property that has the name capacity. 
            allDay: false,
            start: new Date(event.start.dateTime + "z"), 
            end: new Date(event.end.dateTime + "z"),
        }
    });

I've tried looking in ms graph explorer, /v1.0/me/events still no property called capacity. https://developer.microsoft.com/en-us/graph/graph-explorer

1

There are 1 best solutions below

5
user2250152 On

You need to use displayName property of the location and make another call to this endpoint

https://graph.microsoft.com/v1.0/places/microsoft.graph.room
https://graph.microsoft.com/v1.0/places/microsoft.graph.room?$filter=displayName eq '{name}'

Which returns the collection of rooms.

Room resource type has property capacity which specifies the capacity of the room.

Resources:

List places