News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Error when running the test javascript app
Tags: developers
Feb 9, 2021 at 10:15am   •   1 replies  •  0 likes
Bob Lozinak

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

1 Answer
answered on Feb 10, 2021 at 12:41pm  

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


 0
on Feb 10, 2021 at 12:45pm   •  0 likes

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>"


on Feb 10, 2021 at 1:51pm   •  0 likes

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

on Feb 12, 2021 at 10:22am   •  0 likes

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

on Feb 12, 2021 at 10:56am   •  0 likes

Done. Try it pls.

on Feb 12, 2021 at 11:36am   •  0 likes

Hello, that did not fix it, But I did find the issue:

RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com/'

had a trailing slash....


Thanks for all the help



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us