Genesys Cloud - Developer Community!

 View Only

Sign Up

Issues with Update the presence of a Microsoft Teams in Genesys

  • 1.  Issues with Update the presence of a Microsoft Teams in Genesys

    Posted 7 hours ago

    Hi,

    I'm trying to implement the blueprint Update the presence of a Microsoft Teams user based upon an inbound interaction, but I've hit a permissions constraint that changes the architecture significantly.

    The constraint: Our Azure AD app can only be granted Presence.ReadWrite.All as a Delegated permission - not Application. This means we cannot update a user's presence using an app-only (client credentials) flow. Instead, every presence update must be performed on behalf of the signed-in agent, using the OAuth 2.0 Authorization Code flow.

    What this means for the implementation:

    1. The agent must authenticate via browser (Authorization Code flow), consent, and get redirected back with an auth code.
    2. That code is exchanged for an access token + refresh token using our app's client_id/client_secret.
    3. The access token is then used to call: POST https://graph.microsoft.com/v1.0/me/presence/setUserPreferredPresence
    4. Since access tokens are short-lived, we'd need to persist the refresh token (securely) per agent so we can silently mint new access tokens when the inbound interaction trigger fires later - without asking the agent to log in every time.

    My questions to the community:

    • Has anyone implemented delegated-permission OAuth flows in combination with Genesys Cloud Data Actions or Integrations, where the token exchange happens once (e.g., at agent login/shift start) and the token/refresh token is then stored against the agent for later use by an automated trigger?

    thanks in advance!

    Amira


    #Integrations

    ------------------------------
    Amira Abdellatif
    DevOps Engineer
    ------------------------------