Graph API Presence through user/{UserPrincipalName}/presence

Graph API Presence through user/{UserPrincipalName}/presence
6

Upvotes

Upvote

 Jun 05 2023
0 Comments 
New

Most routes starting with /users/{...}/... allow id or UserPrincipalName to access the response object.
Like calendareventsdrive and so on. Even /users/{UserPrincipalName}/teamwork/installedApps is allowed.

 

But presence must have id and doesn't work with UserPrincipalName. This seams inconsistent to me.

Therefore, to keep it consistent:

Get access through /users/{id or UserPrincipalName}/presence.

var graphClient = new GraphServiceClient(requestAdapter);

var result = await graphClient.Users["{UserPrincipalName}"].Presence.GetAsync();


See also https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1942