question

Chris Moreno avatar image
Chris Moreno asked Phong Vu commented

Web server app using sdk

I am trying to use the ring central javascript sdk. My created up is for our users only, it is a web server app. I am not clear on how needs to be used to log in and run an endpoint.

I am running this but I keep getting unauthorized for this grant type.


let rcsdk = new RC( {server: RINGCENTRAL_SERVER, clientId: RINGCENTRAL_CLIENTID, clientSecret: RINGCENTRAL_CLIENTSECRET} );
rcsdk
    .login({
        username: 'myusername', // phone number in full format
        extension: '', // leave blank if direct number is used
        password: 'mypassword'
    })
    .then(function(response) {
        console.log(response)
    })
    .catch(function(e) {
        console.log(e.message)
    });

any idea?

authentication
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Phong Vu commented

Login that way is the "Password Flow" authentication so your app's Platform type needs to be "Server only- No UI" type.

4 comments
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

@Phong Vu so if my app is web server, what all do I need?

0 Likes 0 ·

Then you have to implement 3-legged OAuth authentication. See the getting started sample code here.

0 Likes 0 ·

@Phong Vu Oh, I see. If I choose an application with password flow, is the password the credentials that I used to login into Ring Central? along with the clientid, secret and server? (as below)

screen-shot-2021-05-14-at-33906-am.png

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys