OAuth authentication API

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hey, I am trying to get the access token and refresh token. I am sending the request using curl. I have followed all the steps written in API docs. The response I am getting is 

{

  "error" : "invalid_grant",

  "error_description" : "Invalid resource owner credentials."

}

Can u tell me what's wrong with that ????

Thank You!!!
Photo of Sumit Agarwal

Sumit Agarwal

  • 150 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of VB

VB, Official Rep

  • 1,510 Points 1k badge 2x thumb

This error indicates that the user credentials provided are improper, e.g. username, extension, and/or password.

Below is information on getting your proper credentials in the Sandbox Environment and Production Environment.

1) Sandbox Environment User Credentials

If you are on Sandbox Environment,  follow the below steps to get your sandbox account credentials:

  1. Login to https://developer.ringcentral.com/ using your Developer Platform credentials (RC account credentials)
  2. Go to your Sandbox Account page: "My Account > Sandbox Account". Locate the "Main Company Number" which will be your username when formatted in E.164 format, (example: +12223334444).  
  3. The password is the password you received via email when you created the sandbox account, unless you have changed the password.
The above credentials can also be used for logging into, and reset at, the Online Account Portal for Sandbox Environment at: https://service.devtest.ringcentral.com/

In addition to your user credentials, you need to ensure you are connecting to the correct Sandbox API end point and using the correct application credentials described below:
  1. For sandbox environment, the API sever end endpoint URI is  https://platform.devtest.ringcentral.com 
  2. Find your application key and secret by clicking on My Account -> Applications -> Application Name. Use Sandbox Application key and secrets

The easiest way to start testing our APIs would be by using our  API Explore here  http://ringcentral.github.io/api-explorer/. You can start filling out your RC sandbox credentials and start going from there. We have self explanatory documentation in the link above.

2) Production Environment

If you are on Production Environment, follow the below steps to get your production account credentials:

  1. The user credentials for production are the same ones as for your RingCentral phone account that you use, e.g. to log into the Online Account Portal at https://service.ringcentral.com.
In addition to your user credentials, you need to ensure you are connecting to the correct Production API end point and using the correct application credentials described below:
  1. For production environment, the sever end endpoint uri is  https://platform.ringcentral.com 
  2. Find your application key and secret by clicking on My Account -> Applications -> Application Name. Use Production Application key and secrets

For more information please visit this link: https://developer.ringcentral.com/library/tutorials/test-account.html

(Edited)