Data Action takes failure path in architect on 4xx repsonse

We have a web service data action calling an external API to create a ticket. Sometimes we get a 422 status code back that we would like to retrieve and act upon. However in our Inbound Chat architect flow it goes through the failure path even though the data action technically succeeded. Is this expected behavior or can we do something about it. For me there is a difference between the data action failing and the external api returning a failure code.

From the perspective of data actions, any non 2xx response from the end point will be treated as an error, immediately ending processing. While the request to the endpoint may have accomplished what you wanted, the data action considers this a failure.

The data action does have "Failure Outputs" that you can bind to in your flow. Specifically the 'status' one seems like it should return the http status code that the remote endpoint returned. I know that these failure outputs do not work in voice IVR flows, however I think that they may work in a chat flow. I suggest testing it out seeing if it gets you what you are looking for.

--Jason

Thank you, I guess the best option would be to add a middle-ware between that adds the status code as a json body instead.

I'll do some tests with the failure outputs. Thanks for the tips.

Br Oscar

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.