API responses not working


So I created an API specification with these error responses.
description: Bad request. ID must be an integer
description: Authorization information is missing or invalid
headers: {}
content: {}
description: Not found
description: Interal server error (500)
When I uploaded the spec into snaplogic and changed the pipeline I want it to fetch data from SQL server select with given ID. I want to reroute the error when the ID is not found.

But when I do that I still get on the API call the Server error 500 form the snap itself of snaplogic and not from the reroute or from the specification defined error response

Does someone know why it does not reroute the error to my custom error view or the response code from my api specification

1 Like

From the error you posted, the Map data snap is looking for $ID but $ID does not exist in the document stream, check your input doc values

1 Like

I agree with @jcornelius, The snap with label “Map data” is failing because it’s not receiving the ID field. Basing on your explanation, the ID field should be in the “original” object, so you should map $original.ID

JFYI to trap error I used the $statusCode

Hi jcornelius, Yeah I saw I forget to change that but there was also something else. I’m now investigating it and if I don’t find it I will post the correct topic. Thanks for the info.