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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,066 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hitesh Pachipulusu - MSFT 2,145 Reputation points Microsoft Vendor
    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.


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.