presence: setStatusMessage - Throws 401 error

Schellner, Toni 20 Reputation points
2024-09-23T10:29:04.72+00:00

Hey, I am trying to use Graph API to set the status message of another user. I tried it via PowerShell and Graph Explorer and both ways gave me the same error.

"message": "Cannot set the presence of another user. Authenticated user: 

I followed the provided example from this documentation:

https://learn.microsoft.com/en-us/graph/api/presence-setstatusmessage?view=graph-rest-1.0&tabs=http

I also granted myself sufficient permissions. Are there any errors or limitation with this particular API call?

User's image

Microsoft Security | Microsoft Graph

Answer accepted by question author
Hitesh Pachipulusu - MSFT 3,640 Reputation points Microsoft External Staff
2024-09-23T13:11:57.0333333+00:00

Hello Schellner, Toni,

Thank you for reaching out to Microsoft Support!

It looks like you’re encountering a common issue with the Microsoft Graph API when trying to set the presence status message for another user. The error message “Cannot set the presence of another user” typically indicates a limitation or permission issue.

Here are a few key points to consider:

  1. Permissions: Ensure that you have the correct permissions. For setting the presence status message, you need the Presence.ReadWrite permission for delegated scenarios or Presence.ReadWrite.All for application scenarios.
  2. Delegated vs. Application Permissions: The API call to set the presence status message for another user requires application permissions (Presence.ReadWrite.All). Delegated permissions (Presence.ReadWrite) are not sufficient for this operation.

You cannot use Graph Explorer to set the presence of another user. Please use Application permissions to set the presence of another user.

Hope this helps.

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

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.