cancel
Showing results for 
Search instead for 
Did you mean: 

VSZ REST API calls fail as 401 unauthorized multiple times before succeeding through Rails app

kkerley
New Contributor

My team is building a website using React and Ruby on Rails that interacts with a few VSZ servers. We have extensive Postman requests covering all of the requests we need to make, built out with expected payloads and whatnot. Everything works perfectly making the calls directly to the VSZ servers through Postman.

However, custom REST API endpoints in the Rails application that handle making the same requests almost always result in 1-4 failed calls, returning a 401 unauthorized response. We are using the Faraday gem for making these requests from Rails.

We have performed extensive logging throughout our code and have confirmed multiple times that each request is properly formatted, with a valid serviceTicket included in each, but for some reason, the requests are rejected until ultimately getting a successful response.

On the front end, there's no real impact to the UX aside from wildly varying loading times for these requests. But on the backend, we see all of these failed requests and cannot figure out what about Faraday/Rails in general that could be causing these requests to fail repeatedly before finally succeeding, while always succeeding when being made directly in Postman.

Is there something not obvious in the docs that needs to be configured in the Faraday client? Everyone is stumped trying to figure out how the same call isn't valid...until it is?

To note: we are all trying this locally, from http://localhost. There has been no attempt at trying anything from the remote staging servers yet.

And on top of that, is there any concern about all of these failed requests being made? Are there limits we could hit that could get us in trouble or even cause our account to be locked/flagged?

0 REPLIES 0