How can I get user's presence for Graph API using a daemon

Sonego, Mateus Henrique 21 Reputation points
2022-11-15T20:13:51.733+00:00

I'm trying to build a daemon in c# that will keep getting the user's presence from a list. The problem is that I'm not finding a way to get the token for the user's presence endpoint because it only works with delegated permission. Is there a way to get the user's presence from a daemon/service?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,568 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,454 questions
0 comments No comments
{count} votes

Accepted answer
  1. awijekoon 950 Reputation points Microsoft Vendor
    2023-12-25T00:09:44.1466667+00:00

    @HarmeetSingh7172

    Get User Presence API with Application Permission now available in Graph v1.0. I verified it.

    See this comment too from December 21, 2023. The Graph API change log is not yet updated.

    therefore, following Api should work now with application permission.

    https://graph.microsoft.com/v1.0/users/6e7b768e-07e2-4810-8459-485f84f8f204/presence
    
    https://graph.microsoft.com/v1.0/communications/presences/6e7b768e-07e2-4810-8459-485f84f8f204
    

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


1 additional answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,811 Reputation points
    2022-11-15T20:50:37.593+00:00

    Hello @Sonego, Mateus Henrique

    Thanks for reaching out!

    Get presence API does not support Application Permissions yet.

    260665-gp1.png

    Since this feature/functionality is presently not available for Application Permissions with Microsoft Graph API, you can upvote an existing feature request idea, so that it can get more upvotes. This feature request portal is monitored by Microsoft team, and they make the enhancements to Microsoft Graph APIs based on the number of upvotes/API in demand. I will also upvote for you.

    Related article: https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/graph-api-presence-should-support-application-permissions/idi-p/2276109

    Hope this helps.

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

    0 comments No comments