Legacy Dev Forum Posts

 View Only

Sign Up

401 unauthorized response when requesting Presence and RoutingStatus

  • 1.  401 unauthorized response when requesting Presence and RoutingStatus

    Posted 06-05-2025 18:23

    senthil_embrava | 2022-08-17 09:09:00 UTC | #1

    Hi,

    We have an issue with our OAuth client with one of our customers. Our OAuth client uses Token Implicit Grant and obtain the access token and it is valid for 48 hours. We use this OAuth client in our AppFoundry PureCloud Premium app.

    Also we have not been forcing our client to get multiple access tokens. Unless if the user logs in and out of the PureCloud session, our client uses the same access token. In this scenario, we receive 401 unauthorized response while getting the presence and routing statuses. This is happening most of the time. We use the same access token to create the notification channel using WebSocket for getting the presence, routing status, out of office, call conversation notifications delivered over WebSocket message. The customer confirmed that this happens when he logins to PureCloud session from with-in minutes of signing-in, that means there is no chance for expiry of the access token.

    The urls are as follows:

    For getting routing status: https GET request api/v2/users/userid/routingstatus For getting presence status: https GET request api/v2/users/userid/presences/PURECLOUD

    Even when we receive the 401 unauthorized error, we still get the presence, routing status, out of office and call conversation notifications delivered through websocket channel. So may we know the reason why the server returns 401 unauthorized even though that token is valid and passed in the Authorization header of the GET request?

    Thanks, Senthil


    Eos_Rios | 2022-08-17 11:45:11 UTC | #2

    Because this deals with your specific instance of Pure Cloud and not a more general concept you'd probably need to open a support case with customer care so they can help you and look directly at your environment and situation to understand the issue.


    senthil_embrava | 2022-08-17 12:58:38 UTC | #3

    Sure, we will contact the customer care team who maintains that PureCloud instance. Thank you.


    Ebenezer_Osei | 2022-08-25 14:00:04 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 15919