Presence status of user is taking long time to set using Graph API. Sometimes does not update even for hours

Prajakta Kenjale 41 Reputation points
2022-06-23T10:12:20.937+00:00

We are using presence/setPresence API as given in https://learn.microsoft.com/en-us/graph/api/presence-setpresence?view=graph-rest-1.0&tabs=http through Postman.

It is giving 200 Ok. However, it is not showing any change on MS Teams Client.

When I Change presence status from Teams, I am able to get the updated presence in Postman using https://learn.microsoft.com/en-us/graph/api/presence-get?view=graph-rest-1.0&tabs=http

I am using MS Teams only on my laptop and trying to update presence using postman using Graph API. I am not using MS Teams on multiple devices.

Please help me to understand why it is not updating using setPresence Graph API.

Is there any precedence related issue

Is the issue due to beta version for setPresence https://graph.microsoft.com/beta/users/<userId>/presence/setPresence and we are using V1 version to get presence https://graph.microsoft.com/v1.0/<userId>/presence

Microsoft Teams | Development
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

3 answers

Sort by: Most helpful
  1. Prajakta Kenjale 41 Reputation points
    2022-06-24T06:28:46.747+00:00

    Thanks Prasad-MSFT

    1. When session states are aggregated? as per the document when user is logged in on multiple devices like (desktop, mobile, and web). I am logged in only on one device for sure. In this case which session states will be aggregated?
    2. Busy > Available > Away: Does that mean if user state is Busy, application cannot set it to Available/Away and if state is Available, application cannot set it to Away?
    3. We are using Application Token to set the presence status using setPresence Graph API. Application Token has permission (Presence.Read Presence.Read.All Presence.ReadWrite.All) is this correct? When you are saying User-configured > app-configured, are you suggesting to use user Token with permission (Presence.Read Presence.Read.All Presence.ReadWrite.All) rather than Application Token?
    4. If user has set the presence to Busy, are you saying that the Application cannot set the presence status to Available/Away as per precedence?
    5. When you are pointing to user-configured presence status, does it mean using User Token? Or user is logged in and then getting some token to set?

  2. Prajakta Kenjale 41 Reputation points
    2022-06-24T07:45:04.013+00:00

    Prasad-MSFT,

    Can you let me know which API to be used to sign in a user through application?
    Can we have a quick call?


  3. Prajakta Kenjale 41 Reputation points
    2022-06-24T11:42:06.077+00:00

    We are developing application where we want to update user presence from application.
    We are using POST /users/{userId}/presence/setPresence of beta - https://graph.microsoft.com/beta/users/<userId>/presence/setPresence

    We have added permission Delegated - Presence.ReadWrite
    Application- Presence.ReadWrite.All

    214811-image.png

    1. Other than this, what shall I user in order to change user presence status through my application with any sequence (without precedence).
    2. How can I get permissions same as MS Teams standard client which we download from Microsoft website.
    3. Can you point to the API for user login.

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.