Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

c# - How to display a list of available meeting rooms at present using Microsoft Graph API

I have been trying to play around with the Microsoft Graph API. I have a situation here. I have assigned some meeting rooms with an email ID and want to know the availability of all. If the rooms are available currently , I should get the name of the meeting room and if possible , the duration for which the room is available. I want to know how to query multiple rooms and return the data.

A bit confused about the following APIs, would these help ?

https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/user_findmeetingtimes

GET https://graph.microsoft.com/beta/me/calendar
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have assigned some meeting rooms with an email ID and want to know the availability of all.

The findMeetingTimes API should suit your scenario. For the assigned meeting rooms, you can list them inside locationConstraint parameter of request body, for the assigned attendee email ID, you can add it to attendees parameter of request body. Then the response of this API will return a list of meeting time suggestions based on the meeting rooms are available and all attendees are available. And the the names of rooms available are listed on "locations" of every suggestion.

You can test this API with the example inside the document. My testing result:

enter image description here

Update:

Pay attention that check the permissions inside the document for using this API. Firstly, the account should be work or school account, personal Microsoft account is not supported. Secondly,you need to have Calendars.Read.Shared, Calendars.ReadWrite.Shared permissions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...