Skip to main content
The First Step
December 16, 2021
Solved

Can't get the basic token

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!



    Answer
    December 16, 2021

    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]'

    3 replies

    PhongVu
    Community Manager
    Community Manager
    December 16, 2021

    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

    Answer
    December 16, 2021

    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]'
    adrian-2The First StepAuthor
    The First Step
    December 17, 2021

    Thank you. Separating onto separate lines helped.