question

Bob Lozinak avatar image
Bob Lozinak asked Becky-Community_Manager edited

Error when running the test javascript app

I have tried the SMS quickstart. I followed the Javascript example. But I get an error: Resource Not Available when trying to login in to ringcentral.

I am using my normal login account for the test app. It is in the sandbox. Below is the code.

const RC = require('@ringcentral/sdk').SDK
console.log("hello");
RECIPIENT = '716510xxx'
RINGCENTRAL_CLIENTID = 'qnxxxxx'
RINGCENTRAL_CLIENTSECRET = '3ec_nqkXQxxxx'
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com/'
RINGCENTRAL_USERNAME = '+17168375727'
RINGCENTRAL_PASSWORD = 'xxxx'
RINGCENTRAL_EXTENSION = '102'
var rcsdk = new RC( {server: RINGCENTRAL_SERVER, clientId: RINGCENTRAL_CLIENTID, clientSecret: RINGCENTRAL_CLIENTSECRET} );
var platform = rcsdk.platform();
platform.login( {username: RINGCENTRAL_USERNAME, password: RINGCENTRAL_PASSWORD, extension: RINGCENTRAL_EXTENSION} )
platform.on(platform.events.loginSuccess, function(e){
  console.log("logged in");  
  read_extension_phone_number()
});

Error is gotten at Console.log("Logged in")

Below is the error I get:

capturerc.png

developer sandbox
capturerc.png (23.4 KiB)
1 |3000

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 Bob Lozinak commented

Is this the correct main company number (+17168375727) of your sandbox? I could not find any sandbox account with this number.

5 comments
1 |3000

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

Bob Lozinak avatar image Bob Lozinak commented ·

No, I was wrong and put in the main company number. Below is what i am using currently:

    "RINGCENTRAL_CLIENTID": "qncacxxx0WQ1jOxxxx",
    "RINGCENTRAL_CLIENTSECRET": "3ec_nqkxxxxx",
    "RINGCENTRAL_SERVER": "https://platform.devtest.ringcentral.com",
    "RINGCENTRAL_USERNAME": "+14242692261",
    "RINGCENTRAL_EXTENSION": "101",
    "RINGCENTRAL_PASSWORD": "<YOUR ACCOUNT PASSWORD>"


0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Bob Lozinak commented ·

It looks like you have not setup your sandbox account yet. Log in your dev portal (developers.ringcentral.com) and navigate to the Sandbox Accounts page and click on the icon under the "Online Account Portal" to set it up. When you provide the password for your sandbox, use that password to login.

screen-shot-2021-02-10-at-14817-pm.png

0 Likes 0 ·
Bob Lozinak avatar image Bob Lozinak Phong Vu ♦♦ commented ·

I am still getting the same error. But when I was poking around the account I found this. Can you add SMS to my account. That is what I want to develop.

download.png

0 Likes 0 ·
download.png (26.2 KiB)
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