Tuesday, December 7, 2021

Get Presence Teams Graph API updated

Must read

avatar
Vesa Nopanenhttps://myteamsday.com/
MVP for Office Apps & Services (Teams & Collaboration focus), Principal Consultant in Office 365 and Modern Work. Extremely passionate about Microsoft Teams's power to change how people work together. Helping and coaching customers to find benefits, solutions and value when adopting new tools, methods, ways or working and practices into daily work-life equation. I am always eager to challenge current situation and dig out new possibilities and ways to think and work. You could describe me as a jack of all trades but my main focus area and deep personal driver is Microsoft Teams since it has changed the way I work and did a giant step forward to make it possible to work from anywhere - the location does not matter even us much as it mattered before. Microsoft Teams opened the path for many organizations to rethink their practices, worklife, culture and start the change. That's why I am very passionate about Teams.

I initially tested Get Presence Graph API over a year ago and a revisit showed it has been updated recently. You can now retrieve Out of Office information along with it!

To get started with it easily – and to see how it works – I recommend using Graph Explorer. It allows you to use delegated permissions and play around with Graph API requests & returns. Whenever I work with Graph API I always start with the Graph Explorer. It is a lot faster to tune your calls in it than running a Cloud Flow.

You can see these recent changes in beta version. And easy start is to call it on your self.

First – sign-in to Graph Explorer on the left

GET https://graph.microsoft.com/beta/me/presence

Make sure that you choose that you are testing out with beta version. If you want to test API with 1.0 then choose it from the dropdown.

When you are ready hit “Run query”. And then you will get an error:

You will have to open Modify permissions -tab and give yourself permission to access the information. If you don’t have permission to do this in your work environment then I suggest you test this with a development, trial or demo tenant.

You will need to Consent both.

And then we run the query again

And we got an answer!

Once we set the Out of Office in Microsoft Teams (yes – you can do this in Public Preview now!) we can eventually see the result. It will take some time before it updates to system once you set it in Teams.

What we unfortunately don’t get out of Get Presence API is the status message. And we are not able to set these via API either. Read more & up to date information from Microsoft Docs.

More articles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest articles