question

tayyab-sajjad6063 avatar image
tayyab-sajjad6063 asked Rahul G answered

Authorize API with Web Application Failed

I am trying to connect my web app to ringcentral for sending Fax but i am unable to authorize my application to ringcentral.When i am trying to run sample GIT folder it is giving unauthorized error.

Test 1: authData.php Auth exception: Refresh token has expired Exception: Unauthorized for this grant type SDK HTTP Error at https://platform.devtest.ringcentral.com/restapi/oauth/token Response text: { "error" : "unauthorized_client", "error_description" : "Unauthorized for this grant type", "errors" : [ { "errorCode" : "OAU-251", "message" : "Unauthorized for this grant type" } ] } Previous: Response has unsuccessful status



#Windows #PHP



sdk
1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
The key message is "Unauthorized for this grant type".

Please check your app to make sure it supports the grant type.

Ref: https://github.com/ringcentral/ringcentral-php/issues/39#issuecomment-242907546 
1 |3000

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

tayyab-sajjad6063 avatar image
tayyab-sajjad6063 answered
See it is not showing the password flow option..... Please help me 

1 |3000

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

Tyler Liu avatar image
Tyler Liu answered

If it's a sandbox app, you can simply create a new app instead to enable password flow.

By the way, public app doesn't support password flow.

If you have difficulty configuring it, please contact the developer support team or submit a support ticket.

1 |3000

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

tayyab-sajjad6063 avatar image
tayyab-sajjad6063 answered Tyler Liu commented
Can you help me how to resolve this ?


1 comment
1 |3000

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

Tyler Liu avatar image Tyler Liu ♦ commented ·

I am a developer support and I am not good at the issue you encountered. Please contact customer support instead: https://support.ringcentral.com/ Thank you.

0 Likes 0 ·
Anirban avatar image
Anirban answered Anirban edited

This a common issue user face. Similar type of question raised here.

More precisely discussed here.

If you're using an OAuth 2.0 request using the OAuth 2.0 password grant (grant_type=password), then your application you created should in the RingCentral Developer Portal should be Password flow .

Please note, application created with different platform type will have different grant_type.

For example, application created for platform type = browser based will have grant_type=Authorization Code | Implicit | Refresh Access Token where as application for platform type = Desktop/Windows will have grant_type= Authorization Code | Password flow |Refresh Access Token

So in order to use (grant_type=password) you need to have application created with platform type that support Password flow

Here is wonderful way it has answered with animated Gif image that will easily help you to understand the proccess: https://stackoverflow.com/questions/47692828/ringcentral-auth-token-failed-in-curl-call-unauthorized-for-this-grant-type/47745436#47745436

1 |3000

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

Rahul G avatar image
Rahul G answered
1 |3000

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