Developing custom web part to display Microsoft Teams Presence as well as chart

Copper Contributor

Hello,

 

I would like to develop a custom web part in SharePoint Online which will provide me the list of Active users on Microsoft Teams based on presence like Available, Away etc. Also, I would like to develop a chart which will show me the number of available hours of each user on each day on Microsoft Teams.

 

Any idea?

 

Thanks,

Sohaib

3 Replies
Take a look at Microsoft Teams Graph API + GitHub repositories in regards of control presence in Teams

Hi @Sohaib_Khan ,

 

For presence information, you can use Microsoft Graph's Presence API and use getPresencesByUserId endpoint. https://docs.microsoft.com/en-us/graph/api/cloudcommunications-getpresencesbyuserid?view=graph-rest-...

I have created an example web part displaying presence of team members, which utilizes that endpoint.

https://github.com/mpaukkon/SharePoint/tree/master/spfx-webparts/react-team-presence

 

For displaying free calendar slots, you can use getSchedule Graph API endpoint: https://docs.microsoft.com/en-us/graph/api/calendar-getschedule?view=graph-rest-1.0&tabs=http

 

Hi @Matti Paukkonen,

 

can you post a screenshot of your custom web part?

 

Best regards

Marcus