question

zgrada-zgrada11937 avatar image
zgrada-zgrada11937 asked Anirban answered

Oauth/token server 400 error

Hi,


I have to many errors when I look at analytics tab - endpoints. Most of them are oauth/token post,


Application type is Server-Only.

I am using c# client and code is below.


rc = new RestClient(AppKey, AppSecretKey, Server);

await rc.Authorize(Username, Extension, Password);

var account = rc.Restapi().Account();

var extension = account.Extension();

var response = await extension.MessageStore().List();


The error I've got is:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.209.29.78:443



Flurl.Http.FlurlHttpException: Call failed. An error occurred while sending the request. GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.209.29.78:443

sdk
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.

zgrada-zgrada11937 avatar image
zgrada-zgrada11937 answered
Anyone?
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.

Tyler Liu avatar image
Tyler Liu answered
The error is just network connection error.  Could you please please try from a different network?

And can you open this page in browser?  https://platform.devtest.ringcentral.com/restapi/v1.0
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.

zgrada-zgrada11937 avatar image
zgrada-zgrada11937 answered Tyler Liu commented
Yes, I can open that page. Button Apply for Production is disabled and we cannot promote our application to production. The reason is that we have >5% 4xx errors. As you can see from screenshot below  the only error is related with oauth/token.




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.

The oauth/token error might be caused by  https://github.com/ringcentral/ringcentral-csharp-client#auto-refresh. Please disable auto refresh.


You need to troubleshoot why are there so many 4xx errors
0 Likes 0 ·
Anirban avatar image
Anirban answered

System.Net.Sockets.SocketException: is a connection issue which occurs if the server is unreachable or there is a network issue between client app and the server.

4xx error you are getting may be your code issue with oauth refresh which is done by auto refresh in the code.

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