question

kraig-qin2881 avatar image
kraig-qin2881 asked benjamin-dean answered

unable to get token and api

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





rest api
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

anton-nikitin avatar image
anton-nikitin answered kraig-qin2881 commented
I suspect that it is because of username: your username has to be Sandbox phone number in E.164 format (i.e. +18575984477).
1 comment
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks for your respond, it is still doesn't work. there are show me 

Curl
curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" --header "Authorization: Basic eVV1dENhSW1Uby1LS242Q2M4dlJrUTpMZ0tFMTFjbVFvMjllMGd0TFhtR3lBZTdNVjhEYUxTNHlCWG05ZWthMGJiUQ==" -d "username=%2B19295755692&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:44:37 GMT",
"routingkey": "SJC11P01PAS02",
"content-language": "en",
"content-type": "application/json;charset=UTF-8",
"content-length": "97"
}
I am not sure what is Unauthorized for this grant type? what is my grant type?
0 Likes 0 ·
benjamin-dean avatar image
benjamin-dean answered
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
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

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:

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

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys