Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  GetUsersMe returns a 401

    Posted 06-05-2025 18:06

    scm_pa | 2020-12-31 18:59:05 UTC | #1

    I have an application using the Token Implicit Grant for authorization and the OAuthWebBrowser to have the agent enter their login credentials. In that application I'm calling GetUsersMe() so that I can register some notification handlers and monitor incoming interactions and other topics for that agent.

    In my testing I was pointing to the purecloud.com environment and all was working just fine. The customers org is in the usw2.pure.cloud region so I logged on to their org and set up an oauth client just like I did in my test org and got a client id.

    I then pointed my application to the usw2.pure.cloud region (OAuthWebBrowser.Environment) and use the client id that I had created on their org. When I run the application now, I am able to log into their org just fine but when I call GetUsersMe() it fails with {"message":"Invalid login credentials.","code":"bad.credentials","status":401}.

    In both instances I'm using a redirect url of http://localhost:8085/oauth2/callback . Any suggestions would be greatly appreciated.

    Thank you.


    scm_pa | 2020-12-31 19:18:57 UTC | #2

    Five minutes after I hit send on this I figured it out. I needed to do setbasepath to point to the appropriate region.

    Configuration.Default.ApiClient.setBasePath("https://api.usw2.pure.cloud);


    system | 2021-01-31 19:21:57 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 9613