Is it possible to retrieve get presence by "UserPrincipalName" from Microsoft Graph API?

Amir Sohail 416 Reputation points
2021-12-02T07:22:01.537+00:00

Hello everyone,
I hope you all are feeling well!

Please correct me if I am wrong. I want to pull/fetch user status from the get_presence graph API using "userPrincipalName" e.g
****https://graph.microsoft.com/beta/users/XYZ[@](/users/na/?userId=19d591f5-0000-0003-0000-000000000000).com/presence\*\*\*\*

when I used ID to get presence status from graph API then postman response right like
****https://graph.microsoft.com/beta/users/{id}/presence\*\*\*\*

154343-getpresencebyid.jpg

when I try to get user presence status user Mail/userPrincipalName then the response is not right. like
****https://graph.microsoft.com/beta/users/XYZ[@](/users/na/?userId=19d591f5-0000-0003-0000-000000000000).com/presence\*\*\*\*

154319-getpresencebyemailaddress.jpg

If it is possible to Get Presence by Mail/userPrincipalName then post a query for me thanks in advance.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2021-12-02T08:50:44.27+00:00

    Afaik you need to provide the GUID of the user, the API cannot resolve the object when specifying other identifiers such as UPN.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.