Share via

Graph Teams Presence showing PresenceUnknown, even when granted permissions

Kevin Crouch 81 Reputation points
Jun 30, 2022, 3:44 PM

When I try to query https://graph.microsoft.com/beta/users/<userid>/presence or https://graph.microsoft.com/beta/users('<userID>')/presence Graph gives me a result like { "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('<UserID>')/presence/$entity", "id": "<UserID>", "availability": "PresenceUnknown", "activity": "PresenceUnknown", "outOfOfficeSettings": null } I have already consented to the Presence.Read and Presence.Read.All ![216651-image.png][1] And I can confirm they are added to my token under "Access Token" > { } Additionally, I have a number of other Scopes added already from previous testing. #manually spread by category and made more readable scp: Presence.Read, Presence.Read.All User.Read User.Read.All openid profile email Channel.ReadBasic.All, ChannelMessage.Read.All, ChannelSettings.ReadWrite.All, Chat.Read, DeviceManagementApps.ReadWrite.All Mail.Read, Mail.Read.Shared, Mail.ReadWrite, Mail.ReadWrite.Shared Reports.Read.All TeamsAppInstallation.ReadForTeam, TeamsTab.ReadWrite.All, TeamsTab.ReadWriteForTeam At first I was suspecting that maybe it was trying to read availability from "Exchange" and so maybe it needed mail permissions, or User.Read.All permissions, though they weren't listed. With Prescence.ReadWrite.All - I would expect this to work alone, and with those extra permissions that I already had on here of User.Read.All - I'm not sure what else it may be looking for [1]: /api/attachments/216651-image.png?platform=QnA

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,128 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,595 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShivaniRai-MSFT-7217 2,741 Reputation points
    Jun 30, 2022, 4:33 PM

    Hi anonymous user,

    As per my test I am getting PresenceUnknown value when I am not logged in to teams. As soon as I login to teams and then hit this Endpoint value changed to Available(Refer below example screenshot):
    216567-image.png

    You have required permission to run this API, Please make sure that you have logged in to teams also then try to run this API.

    Also, if I am trying to get presence of another user (other than me) I am not getting the updated status of user. However this Graph API endpoint https://graph.microsoft.com/v1.0/communications/presences/<user-Id> is giving me correct results. You can use it as a workaround for other users (refer below example screenshot):
    216575-image.png

    Reference Document: https://learn.microsoft.com/en-us/graph/api/presence-get?view=graph-rest-1.0&tabs=http

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.