question

Paul Fleming avatar image
Paul Fleming asked Paul Fleming answered

Access code invalidates - fails with BadRequest

Hi,

We are getting BadRequest error when trying to generate an access token from refresh token.

To give a bit more context to it we have a .net application that integrates with RC to retrieve the calls. For this, we have a background job hosted in azure. As part of this job, we make HTTP request to generate the access token sending the request to /restapi/oauth/token . We generate a new access token every 10 mins.

What we are seeing is that this job seems to run for days and then for no reason it starts to fail with bad request error. Once it starts failing it never picks up and eventually the access token expires and once the access token is expired there is no way to get the job to run successfully and we have to get back to the customer to authorise again.

We have seen this happen a couple of times now and not sure what would be causing this kind of behaviour.

Any help would be greatly appreciated.

Thanks

authentication
1 |3000

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

Phong Vu avatar image
Phong Vu answered

A few questions for you.

1/ Are you using the .Net SDK or your own code? For the part you generate the access token and the also the part your app call other APIs.

2/ What type of app, password flow or 3-legged authorization flow?

3/ Can you print the error message or more from the response/header

1 |3000

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

Paul Fleming avatar image
Paul Fleming answered

Thanks for your response.

We are using 3-legged authorization flow and are using our own code for all RingCentral request.

Unfortunately, we are not capturing error response and the only info we have is 400-BadRequest.

However, we are adding more logging to this process and deploying it today so that we get more information when it fails next.


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