Microsoft Graph 'GetPresence' without user sign-in

Baha Bayar 40 Reputation points
2023-03-22T08:55:04.36+00:00

Hi!

I tried to send a request to "/communications/presences/{userId}", but I only received a 200 (Success) response when I made a sign-in (using Delegated access token).

However, I need to do this without any sign-in scenario.

Is there any chance to do this without any sign-in scenario?

Note: I gave API permission for DelegatedPermissionGrant.ReadWrite.All, but I still can't receive any 200 (Success) response

question for microsoft

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,715 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,737 questions
0 comments No comments
{count} votes

Accepted answer
  1. HarmeetSingh7172 4,811 Reputation points
    2023-03-22T19:12:55.25+00:00

    Hello Baha Bayar,

    Thanks for reaching out!

    As per the documentation, Get Presence Graph API requires an authenticated user context in order to function i.e., works when a signed-in user is present and doesn't support application permissions (without a signed-in a user present).

    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.


1 additional answer

Sort by: Most helpful
  1. awijekoon 1,025 Reputation points Microsoft Vendor
    2023-12-25T00:03:46.5733333+00:00

    Hi @Baha Bayar

    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