Solved

Can't get the basic token

  • 16 December 2021
  • 3 replies
  • 547 views

I created an App in the sandbox, with permissions for SMS and Read-Only. Password-Flow enabled (and private). Client ID is lXbnBnjyQcywt2tt0NFfVA if you want to check.

I plan on accessing it via a FileMaker app API call, but am unable to get the basic credential token, even using Postman. Screenshots from Postman attached...


If I put the grant_type in the body, I get this error:

{ "errorCode": "CMN-001", "message": "Unable to parse URI query",
"errors": [ { "errorCode": "CMN-001", "message": "Unable to parse URI query" } ]}



screen-shot-2021-12-15-at-50443-pm.png

If I put the grant_type in the header, I get this error:

"error": "invalid_request",
"errors": [ { "errorCode": "OAU-250", "message": "Unsupported grant type" } ],
"error_description": "Unsupported grant type"}


screen-shot-2021-12-15-at-50058-pm.png

Any advice would be appreciated...


Thanks!



icon

Best answer by Anonymous 16 December 2021, 22:08

View original

3 replies

Userlevel 1

Grant type, username and password must be in the body. Not sure why you got such an error.

Can you download the code of this project and try in your local machine. Check the authentication implementation code.

Node JS

Python

PHP

Please test this sample curl code snippet for authentication :

curl --location --request POST 'https://platform.[devtest].ringcentral.com/restapi/oauth/token'
--header 'Authorization: Basic [base 64 encoded clientID:clientsecret]'
--header 'Accept: application/json'
--header 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'
--data-urlencode 'grant_type=password'
--data-urlencode 'username= [main phone number]'
--data-urlencode 'password= [password]'
--data-urlencode 'extension=[extension-number]'

Thank you. Separating onto separate lines helped.

Reply