Microsoft Groups Tab Software that makes use of the Graph API and Change FreeBusy Info In my final submit I went over the brand new Graph perform known as getSchedule and the way this can be utilized to get the FreeBusy info for a Person (or Assembly Room, Useful resource Mailbox and many others) and show that as a desk just like the schedule assistant in Outlook.
On this submit I will present you the way you are able to do the identical factor in a Groups tab utility which will provide you with an output one thing like the next
The steps this app takes to show that is firstly
Get the Group Members – As soon as it has an Entry-Token it then Will get the members of the present Group from the Graph by first getting the Id from the Context of the group at present in focus from the Groups Consumer SDK after which making a request to the Teams Endpoint https://graph.microsoft.com/v1.0/teams/
Schedule Request – Make a schedule request of the Members of the Group (word this operation is barely in Beta in the mean time). This returns the FreeBusy info for the members of the group in 30 minute timeslots for the working hours interval I am displaying. Observe the Timezone from the browser (or Groups Consumer) is used right here. Incorrect Time zone of timezone variations are one thing that may have an effect on the outcomes of this operation.
Construct the HTML to Show- Construct the above FreeBusy desk from the Outcomes
Get the UesrPhotos – Backfill the person images asynchronously utilizing the Graph images endpoint.
I’ve additionally applied a config file in
So something that wanted to be hardcoded within the app is on this file which is principally
clientId : “2cff1b6d-82d4-4dc0-9ac4-7f35b06cc64a” – this the Azure App registration which it is best to create your personal of that may listing
redirectUri : “/TeamsFB/app/silent-end.html” – From the Azure App registration
authwindow : “/TeamsFB/app/auth.html” – For the Slient Auth features
hostRoot: “https://gscales.github.io” – For the relative references within the js recordsdata
this makes it simple if you wish to change the host or use ngrok to host it, eg simply change hostRoot, Azure RedirectURI to the ngrok handle and try to be good to go.
Permissions for Azure App registration
As a result of this app accesses varied graph endpoints totally different oauth Grants should be allowed eg
- Group members Person.Learn and Group.Learn.All
- FreeBusyInformation Calendar.Learn
- UserPhotos Person.ReadBasic.All
Azure app registration – you want to have an app registration that’s Authorised inside you tenant (see my final submit for extra particulars)
For this pattern that is situated in https://github.com/gscales/gscales.github.io/tree/grasp/TeamsFB/TabPackage
All of the code for this pattern is offered in GitHub right here https://github.com/gscales/gscales.github.io/tree/grasp/TeamsFB
Its additionally hosted in GitHub pages if in case you have a improvement tenant and wish to take a look at it https://gscales.github.io/TeamsFB (you will have to first use the admin consent URL listed above).