GenesysCommunity | 2016-06-08 15:28:08 UTC | #1
Hello,
I'm working on setting up OAuth with the PureCloud API and keep running into issues with 400 errors that return "invalid client", but no further information. I have tried both a Ruby OAuth client, and then tried to walk through with curl to make sure it wasn't a client specific issue, and I am still seeing the same error. The curl code in question is:
curl -Lv -d "granttype=authorizationcode&code=CODEFROMINITIALREDIRECT&redirecturi=http%3A%2F%2Fdropdowns.lvh.me%3A3000%2Fauth%2Foauth%2Fcallback" https://login.mypurecloud.com/token -H "Auhorization: Basic BASE64($clientid:$clientsecret)" -H "Content-Type: application/x-www-form-urlencoded"
(all sensitive tokens/codes have been replaced, but their actual values have been substituted in when I've been trying the calls; also, the redirect_uri is whitelisted in my account)
Also, just to be sure, the clientid and clientsecret listed are the two fields accessible under the OAuth tab of the PureCloud dashboard, correct?
Any tips on what I may be missing, or any small syntax issues?
GenesysCommunity | 2016-06-08 15:28:42 UTC | #2
After working on this for a while, I also found out that the API calls were failing if I included headers on the token step that were not required. I'm not sure why that is, but as soon as I removed any extraneous headers and only sent what is listed in the documentation, it worked fine.
system | 2017-08-28 19:24:33 UTC | #3
This post was migrated from the old Developer Forum.
ref: 28