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
API Error - CMN-405 : Login to extension required
Tags: rest api, errors, log in
Mar 15, 2022 at 10:00am   •   2 replies  •  0 likes
John Lee

I have established a connection via grant type "password" and generated a token in a sandbox environment.

Now, when I do send a request using any URI, I get the error message below:

{
 
  "errorCode" : "CMN-405",
  "message" : "Login to extension required",
  "errors" : [ {
 
    "errorCode" : "CMN-405",
    "message" : "Login to extension required"
  } ]
}

My script worked querying get-information in another production app, but with this new app in sandbox, it's asking to login to an extension which I have already signed into:
https://service.devtest.ringcentral.com/application/users/users/default

What is really needed to be done to resolve this issue? Your help would be most appreciated.


on Mar 15, 2022 at 12:03pm   •  0 likes

update, also I was able to sign into the RingCentral phone app in the Sandbox Environment following the instruction:


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:

  • Mac OS
  • Windows

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

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys
1 Answer
answered on Mar 16, 2022 at 8:38am  

I use our power tool to generate a token and read your sandbox account with my Node JS code. I could read without any problem.

Since you are using PowerShell, I am not an expert in PS so I am not sure what could be wrong, but I am sure that it's something in the code. You can try just for confirming that all params you use and your sandbox is working normal by using one of our SDKs. E.g. the JS SDK. Here is what I just tested. You can perform a full password flow authentication from the code if you want to.

const RingCentral = require('@ringcentral/sdk').SDK

RINGCENTRAL_CLIENTID = "ZN6iThZnTp2ZyMWbXxxxyyyyzzz";
RINGCENTRAL_CLIENTSECRET = "aaaabbbbbccccc-20PRI1YdAYAv5l0VtUJQaiOaztJOT_mlg";
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com'

var rcsdk = new RingCentral({
      server: RINGCENTRAL_SERVER,
      clientId: RINGCENTRAL_CLIENTID,
      clientSecret: RINGCENTRAL_CLIENTSECRET
  });


var platform = rcsdk.platform()

var tokensObj = {
 "access_token" : "valid-access-token",
 "token_type" : "bearer",
 "expires_in" : 3600,
 "refresh_token" : "abc",
 "refresh_token_expires_in" : 604800,
 "scope" : "ReadAccounts RoleManagement"
}

setToken()

async function setToken(){
  await platform.auth().setData(tokensObj)
  if (platform.loggedIn()){
      console.log("already logged in")
      read_account()
  }else{
    console.log("Tokens expired => Need to relogin!!!")
  }

}

async function read_account() {
  try{
    var resp = await platform.get('/restapi/v1.0/account/~/')
    var jsonObj = await resp.json()
    console.log(jsonObj)
  }catch(e){
    console.log(e.message)
  }
}

 2
on Mar 15, 2022 at 2:39pm   •  0 likes

1. No Authentication issue generating the token.

2. Any URI I use this error message generate.

3. $ClientID = "ZN6iThZnTp2ZyMWbXeb3OA"

1647380246504.png

1647380292301.png

on Mar 15, 2022 at 3:29pm   •  0 likes

And you authenticated with the username and password of the user John Lee? How about if you authenticate with the user name and password of Ming Lee, the super admin in your sandbox account?

on Mar 16, 2022 at 6:27am   •  0 likes

Hi Phong,


3 things I have tried and validated:

1. tried the sandbox account number with extension 101, gets same result

2. tried the sandbox Ming's phonenumber (4378262905) with extension 101, gets same result

3. tried the sandbox John's phonenumber (4378262508) with extension 102, gets same result


*elevated the John's role as Super Admin as well

I don't have problem getting the token validating the required credential though.

1647437217817.png

1647437244602.png

on Mar 16, 2022 at 6:49am   •  0 likes

The same script with other production app does pull extension and account info.

I really hope this gets fixed and get production environment approved.


1647438594983.png

on Mar 15, 2022 at 2:44pm   •  0 likes

It will reject any URI request because the requirement is not met, what does it means by sign into the extension? I could generate the password of the account and used it to establish the api connection.

on Mar 15, 2022 at 2:31pm   •  0 likes

Tell me what exactly you did. Which API returns that error? And your app client id.

on Mar 16, 2022 at 10:55am   •  2 likes

Thank you for your help Phong Vu, I found out that my script had an error on pointing the token correctly, it was caching from previous session.


I was able to query and edit the extension.


Have a great day Sir!



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