Question

unable to get token and api

  • 30 August 2016
  • 2 replies
  • 543 views

just fill out my username, password, app key, app secret, then try it out, there is still not working. Also what is grant-type? i am not sure what should i do.

here is show me information:


Curl

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" --header "Authorization: Basic M3B5UWNrNjFSNFdnb000WkNKd3J2QToxMWNOak0yYVNRcWdxdXh1dFdMd25RdkxXWWl4RHZUY0szeEl5U25vMFJNZw==" -d "username=8575984477&password=8575984477D&extension=101&grant_type=password" "https://platform.devtest.ringcentral.com/restapi/oauth/token"


Request URL

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


Response Body

{    "error": "invalid_grant",    "error_description": "Invalid resource owner credentials."  }


Response Code

400


Response Headers

{
  "date": "Mon, 29 Aug 2016 22:10:07 GMT",
  "routingkey": "SJC11P01PAS02",
  "content-length": "94",
  "content-language": "en",
  "content-type": "application/json;charset=UTF-8"
}






Curl

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" --header "Authorization: Basic dGYxM0wydlBSVGE0WUFOWEo4U1RoUTpNZjNYWEtoTFNSZVM0NGw1cVcxYUNBS3I3NUxNaWxSLVd1cS1FNTBadkdTUQ==" -d "username=8575984477&password=8575984477D&grant_type=password" "https://platform.devtest.ringcentral.com/restapi/oauth/token"


Request URL

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


Response Body

{    "error": "unauthorized_client",    "error_description": "Unauthorized for this grant type"  }


Response Code

400


Response Headers

{
  "date": "Mon, 29 Aug 2016 22:18:14 GMT",
  "routingkey": "SJC11P01PAS02",
  "content-language": "en",
  "content-type": "application/json;charset=UTF-8",
  "content-length": "97"
}  






2 replies

I suspect that it is because of username: your username has to be Sandbox phone number in E.164 format (i.e. +18575984477).
I'm making this a private conversation since you've included your username and password in the posts.

A phone call should not be necessary since we have ample documentation about getting started available online.

The Authorization Types available for your application are determined by the Platform Type (which is immutable once set).

If you need to use the Resource Owner Credentials Password Flow, you will need to create an application with the Platform Type set to "Server Only, No UI". Since that is the only option for this type of auth.

Make sure to use the appropriate user credentials (from within your sandbox account).

We understand your emphasis for getting this into production quickly, but you need to read the documentation (or provide access to your developer and give them the time needed to understand how to work with our platform and to properly follow our documented best practices).

Sincerely,
Benjamin Dean
Developer Relations Manager
RingCentral Platform

Reply