Teams Presence information is now available via Graph API beta interface. It is fairly simply to test using Graph Explorer by calling /beta/me/presence.
Note: you will need to give a admin consent to these API calls. You can not do this with delegated user permissions.
You may want to refer for Presence API documentation in Docs.Microsoft.Com
When you start testing this with Graph Explorer, you are required to give permissions (use Modify Permissions in Graph Explorer)
You can also use /users/(user-id-guid)/presence to retrieve a specific user’s presence:
And there is also /communications/getPresencesByUserID, which is called using POST and a list of user userids (guids) is provided.
As you can see from the activity, these two demo persons were in a call together when status was queried.
Something to note:
- You can not read or set the custom status message in Teams using Presence API
- You can only get the presence, not to set it
- Read the announcement blog post from Developer.Microsoft.Com
6 thoughts on “Testing Microsoft Teams Graph Presence API”
I tried to call Getpresence method in .net , but it doesn’t recognize Presence
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var presence = await graphClient.Me.presence.Request().GetAsync ();
Unfortunately I can’t help with .NET. I have been only using this via REST calls.
Is it possible to edit presence using old Skype API to set custom teams status messages?
Not to my knowledge.. Sorry. I think that would have come up earlier if that were possible.