Web Services - 302 Redirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-08-22 10:25 AM
If we get a 200 OK back it populates them, but I can't seem to find a way to get it to be okay with a 302 as this is what we want to get back when making this API call - please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-08-22 03:19 PM
Hi Max,
This is possible but how you handle errors may need to change.
Because it's not a 200 result it may be getting classed as a "failure" despite it being positive if the return is a 302.
What you can do is inside your process or retry loop if you work in a pathway to read the exception message and see if "302" is in the test with an InString( call.
If it is in the exception message then you can return to the happy path. If it was a 400 exception e.g. invalid password, then you can throw the exception as normal.
Example below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-08-22 04:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-08-22 05:21 PM
Hi Max, if you look at the response content when you generate the 302 error are you able to see the full detail or is it just an error message?
You should be able to add 1 or many calculation stages to read the data into a suitable collection. If you are able to send an example or a safe data example I might be able to help you more.
Another tool that might help you with responses it Postman, it's free to set up and you can see the full response with any response so you can set the outputs in BluePrism to different headers if they are available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-08-22 07:08 PM
Am I correct in thinking that you're using the Web API Service feature to build this? If so, you probably won't have access to the headers as I don't believe BP includes them in the exception detail. This is one of my gripes about this feature. If the response is anything other than an HTTP 2xx code, Blue Prism treats it as an exception and things become challenging.
What I've started doing is simply using the Utility - HTTP VBO to perform all but the absolute most basic HTTP/REST actions. The HTTP VBO gives you significantly more control over the request/response handling.
Cheers,
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-22 08:02 AM
Thanks for this - that's really frustrating, but we'll go ahead and build an object for this instead to cover each API call. Is there a way to feed this into the dev team? It feels like a fairly fundamental feature...
Hi Ronan,
Thanks for your help on this, but as Eric mentioned we need the headers specifically as the content is empty (as expected).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-22 10:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-22 12:42 PM
Regarding the Web API feature, there are several open enhancement requests on it. I believe you can find some of them on the Ideas page.
As for the Content-Length header, are you using the HTTP Request action or one of the others? Generally, Content-Length doesn't need to be provided unless you're using the HTTP Request Multipart action. This leads me to another question. Are you using the latest release of the Utility - HTTP VBO? If not, you can get it from the Digital Exchange at the link below:
https://digitalexchange.blueprism.com/dx/entry/3439/solution/utility---http
Cheers,
Eric
