JSON Response Post api

Hi all,
I am trying to catch the response of a post request to AFAS. I first tried it with postman and used the response json as format in the triggre response json. The response status is working but the body of the response is not catched or or stored. Am i doing something wrong? any suggestios?

Hi @niels.deboer,

It seems that you didn’t match the casing everywhere. The example says results but you used Results. That might be the issue.

Thanks Jesse, this was the problem! I was trying to log this response to see if the response logging is working. I am actually trying to log the errors, for example

Is it possible to catch a 500 response?

Hey @niels.deboer,

Happy that helped :slight_smile:

Catching errors
To catch a 500 response, place a Decision based on the Status code in the Connection action. You can then make a path for a 500 error (if you want, anything from 500 - 599) and for all other status codes use the default path. Here is an example:

Thanks and will use your example!
Do i need to use this setup for catching the error?The problem that i have is that I am getting an empty log/externalMessage text that is in the reply JSON.

You can simply add these fields to the Connection action, in the JSON response.

Triggre only fills the fields that are sent, so the others will simply empty in case of a 500 error and vice-versa.

Good luck on the rest of your integration!

I double-checked my answer, and data is NOT processed for 500 errors. We will discuss whether we should enable data processing for 500 errors in a future release.

1 Like

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