Get a user's presence Microsoft Graph Api

murphy 1 Reputation point
2022-11-21T02:10:03.33+00:00

Hi,

I would like to get the information about a user's presence in MS Teams. Is there a way to make this happen using a graph call?

Thank you very much in advance

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,571 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. HarmeetSingh7172 4,811 Reputation points
    2022-11-21T02:30:18.95+00:00

    Hello @murphy

    Thanks for reaching out!

    Get presence Graph API doesn't support Application Permissions yet. Hence, it is not possible to achieve this using Graph API currently.

    262280-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

  2. CarlZhao-MSFT 36,891 Reputation points
    2022-11-21T07:09:55.723+00:00

    Hi @murphy

    You can call the presence API endpoint to get a user's presence in Teams.

    1.Get the presence information for a specific user (requires Presence.Read.All delegated permission).

    262420-image.png

    2.Get the presence information for multiple users.

    262494-page17.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. awijekoon 950 Reputation points Microsoft Vendor
    2023-12-24T23:53:12.9433333+00:00

    @murphy

    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.

    0 comments No comments

  4. Bhavesh Sharma 0 Reputation points
    2023-12-25T01:21:14.9066667+00:00

    Yes, you can retrieve information about a user's presence in Microsoft Teams using Microsoft Graph API. The presence information is available through the beta version of the API.

    Here's an example of how you can make a Microsoft Graph API call to get a user's presence:

    http

    Copy code

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

    This API call retrieves the presence information for the authenticated user. You can replace me with the user's ID if you want to get the presence information for a specific user.

    Note: Using beta endpoints means the API is not yet finalized and may be subject to change. Ensure you check the Microsoft Graph API documentation for any updates or changes.

    Additionally, make sure your application has the necessary permissions to access presence information. You might need thePresence.Read`or `Presence.Read.All delegated permission.

    Always follow Microsoft's best practices for authentication and authorization when working with Microsoft Graph API.

    0 comments No comments