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
Unauthorized for this grant type
Tags: authentication
Apr 19, 2016 at 5:58pm   •   6 replies  •  0 likes
orchard-medical-center

I have two separate Company Accounts (one main office, one satellite office, each with their own main number) but when calling RingCentral support I hear (press 1 if calling about account called xxxx and 2 if calling about account called yyyy).


Everything worked fine when developing my program in the sandbox for the main office and the program is fully operational never generating any errors.


When I created a sandbox account for the satellite office, getting the Access Token (exactly as I did for the main office) generates the following and I cant figure out why:


Server: nginx/1.8.0Date: Wed, 20 Apr 2016 00:41:01 GMTContent-Type: application/json;charset=UTF-8Content-Length: 100Connection: keep-aliveRcrequestid: 8e2782ee-0690-11e6-bb68-005056bb8059Routingkey: SJC12P01PAS02X-Loadmetric: 6Www-Authenticate: Basic realm="RingCentral REST API"Content-Language: en



{


"error": "unauthorized_client"

"error_description": "Unauthorized for this grant type"

}


The header is


Authorization: Basic OENPRWxEUHRRMWVYY25PMWl6bk1GUxxxxxxxxxxFfS0d6QW1EaGd6NEVBMlg4TjQybC1TRUtiWXRLamZGSDMydw==

Content-Type: application/x-www-form-urlencoded;charset=UTF-8


The Payload is:

grant_type=password&username=+15621234567&password=mypassword



Any help would be greatly appreciate.

6 Answers
answered on Jun 29, 2019 at 7:22am  

es the correct url for access_token is below which many developers make mistakes:

https://platform.devtest.ringcentral.com/restapi/oauth/token

While you can try to get the token setting header

Content-Type: application/x-www-form-urlencoded


 0
answered on Jun 24, 2019 at 1:58am  

Yes the correct url for access_token is below which many developers make mistakes:

https://platform.devtest.ringcentral.com/restapi/oauth/token

While you can try to get the token setting header

Content-Type: application/x-www-form-urlencoded


 0
answered on Apr 29, 2016 at 8:59am  
Thanks for the update. :)

 0
answered on Apr 28, 2016 at 3:32pm  
Yes. All good. Thank you.

 1
answered on Apr 22, 2016 at 4:59pm  
So you're all good now?

 0
answered on Apr 22, 2016 at 10:08am  
The problem included the fact that I was doing EXACTLY what you said.

 It seems the correct URI is https://platform.devtest.ringcentral.com/restapi/oauth/token  and NOT https://platform.devtest.ringcentral.com/restapi/v1.0/oauth/token.

When I requested and Access Token with the first URI, I finally saw the message "STATUS: 200"!!!



 0
answered on Apr 21, 2016 at 3:59pm  
Have you tried removing the plus symbol from the payload?

Have you setup the Sandbox account with a new user in https://service.devtest.ringcentral.com ?

Are you using the correct API Keys (app_key and app_server for your satellite office's new sandbox account)?

Are you using the correct base URI and route: https://platform.devtest.ringcentral.com/restapi/v1.0/oauth/token ?

Have you made sure to add the colon (:) between the app_key and app_secret when you are base64 encoding it?

 0



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