Embedded Voice oauth error

  • 1
  • Problem
  • Updated 5 months ago
Following yesterdays webinar on Embedded Voice, I am trying to integrate this into our CRM. I have created test page with  a copy of the example code, but i keep receiving an oauth error. Please can someone advise? Thanks in advance.

include code:
 <script>
  (function() {
    var rcs = document.createElement("script");
    rcs.src = "https://ringcentral.github.io/ringcentral-embeddable-voice/adapter.js?appKey=itC6A58EQYS0ae-w480bCg&...;
      var rcs0 = document.getElementsByTagName("script")[0];
    rcs0.parentNode.insertBefore(rcs, rcs0);
  })();
</script>

the error code I receive is:
oauth error:  Error: invalid_request
    at o (app.js:1)
    at t.<anonymous> (app.js:1)
    at r (app.js:1)
    at Generator._invoke (app.js:1)
    at Generator.e.(ringcentral.github.io/ringcentral-embeddable-voice/anonymous function) [as next] (https://ringcentral.github.io/ringcentral-embeddable-voice/app.js:1:1191401)
    at r (app.js:1)
    at app.js:1
    at new Promise (<anonymous>)
    at new t (app.js:1)
    at t.<anonymous> (app.js:1)
(anonymous) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
e.(anonymous function) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
t @ app.js:1
(anonymous) @ app.js:1
e @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
e.(anonymous function) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
t @ app.js:1
(anonymous) @ app.js:1
e @ app.js:1
(anonymous) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
e.(anonymous function) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
t @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
postMessage (async)
window.oAuthCallback @ proxy.js:1
(anonymous) @ ringcentral.github.io/ringcentral-embeddable-voice/redirect.js:1
Photo of Nick Buchanan

Nick Buchanan

  • 162 Points 100 badge 2x thumb

Posted 5 months ago

  • 1
Photo of Embbnux Ji

Embbnux Ji

  • 270 Points 250 badge 2x thumb
Hi, Nick. From the error message, it seems that you provide a valid `appKey`. Would you please check the appKey in RingCentral Developer Website. I also try with your appKey.

Got following message from RingCentral API:

{
  "error" : "invalid_client",
  "error_description" : "Invalid client: itC6A58EQYS0ae-w480bCg",
  "errors" : [ {
    "errorCode" : "OAU-153",
    "message" : "Invalid client: itC6A58EQYS0ae-w480bCg",
    "parameters" : [ {
      "parameterName" : "client_id",
      "parameterValue" : "itC6A58EQYS0ae-w480bCg"
    } ]
  } ]
}
Photo of Nick Buchanan

Nick Buchanan

  • 162 Points 100 badge 2x thumb
Hi Embbnux,
I can confirm that the API Key is coorect. I have attached a snippet below...
Photo of Embbnux Ji

Embbnux Ji

  • 270 Points 250 badge 2x thumb
If you just want to test the widget, you can remove configure params as following:

  (function() {
    var rcs = document.createElement("script");
    rcs.src = "https://ringcentral.github.io/ringcentral-embeddable-voice/adapter.js";
    var rcs0 = document.getElementsByTagName("script")[0];
    rcs0.parentNode.insertBefore(rcs, rcs0);
  })();

It will use default config params.
Photo of Embbnux Ji

Embbnux Ji

  • 270 Points 250 badge 2x thumb
I will check with my colleagues why this app doesn't support private app
Photo of Nick Buchanan

Nick Buchanan

  • 162 Points 100 badge 2x thumb
Thank you. Creating a public app has enabled me to log in.
I now see a message saying "Web Phone Unavailable" - Please grant RingCentral Embeddable Voice to access your audio. Where do I enable this please?

It would be useful to have these steps and requirements mentioned in the online documentation/tutorial.
Photo of Embbnux Ji

Embbnux Ji

  • 270 Points 250 badge 2x thumb
Yes, we need to add it to tutorial. For message from this widget, you need to make browser allow this app to use microphone. It should popup alert window in the browser. It will not pop up when browser block it. You can go to `chrome://settings/content/microphone` to diable block and enable it.
Photo of Nick Buchanan

Nick Buchanan

  • 162 Points 100 badge 2x thumb
Hi, yes that solved the problem.
Thank you very much for your help. No I can try and extend the functionality within our CRM.
Does this support the functionality to instigate a call (via click-to-dial), and then at the end of the call grab the call recording ID so that i can then automatically download it and attach to the customers record in our CRM?
Photo of Nick Buchanan

Nick Buchanan

  • 162 Points 100 badge 2x thumb
Hi
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
Hi, I am having problem with implicit grant flow too. 

Nick, could you please inspect the network in Chrome devtools and post the network response here?

I want to confirm that we are talking about the same issue.
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
The issue disappeared on my side.
Photo of Nick Buchanan

Nick Buchanan

  • 162 Points 100 badge 2x thumb
Hi, Did you change anything at your end, or did it just begin to work?