liondepierre
liondepierre

Reputation: 35

Microsoft Graph - Unable to fetch Microsoft exchange room capacity

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

Upvotes: 1

Views: 174

Answers (1)

user2250152
user2250152

Reputation: 20823

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

Upvotes: 0

Related Questions