# JSON Response Post api

**URL:** <https://community.triggre.com/t/json-response-post-api/707>\
**Category:** Support\
**Created:** [May 22, 2024, 8:49am UTC](https://community.triggre.com/t/json-response-post-api/707 "2024-05-22T08:49:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![niels.deboer](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@niels.deboer](https://community.triggre.com/u/niels.deboer)\
**Post date:** [May 22, 2024, 8:49am UTC](https://community.triggre.com/t/json-response-post-api/707/1 "2024-05-22T08:49:08Z")

</div>

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?  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/5ed2f314c30d5bd52fb9577022145b4c82d7bd38.png)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/5a9612201382266c500a23dc6f6bf1a1f12edd2d.png)  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/e153665ee81b5b158edc28986015ee973cd5b15e.png)  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/cc743921c24e5b228bac5d180c67fa489ea1bb0c.png)

---

<div class="post-metadata">

**Author:** ![Jesse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/jesse/32/88_2.png) [@Jesse](https://community.triggre.com/u/Jesse)\
**Post date:** [May 22, 2024, 9:01am UTC](https://community.triggre.com/t/json-response-post-api/707/2 "2024-05-22T09:01:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![niels.deboer](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@niels.deboer](https://community.triggre.com/u/niels.deboer)\
**Post date:** [May 22, 2024, 9:05am UTC](https://community.triggre.com/t/json-response-post-api/707/3 "2024-05-22T09:05:32Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/d8054541588a3a8bce1165f5c065f0eff8e28ffa.png)  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/df780d64ba65bd58a123fa756a864ad37abfcda5.png)  
Is it possible to catch a 500 response?

---

<div class="post-metadata">

**Author:** ![Jesse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/jesse/32/88_2.png) [@Jesse](https://community.triggre.com/u/Jesse)\
**Post date:** [May 22, 2024, 9:32am UTC](https://community.triggre.com/t/json-response-post-api/707/4 "2024-05-22T09:32:40Z")

</div>

Hey @niels.deboer,

Happy that helped 🙂

**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:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/42c2004690aa1bd943e21787b4bc238ba4a7d329.png)

---

<div class="post-metadata">

**Author:** ![niels.deboer](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@niels.deboer](https://community.triggre.com/u/niels.deboer)\
**Post date:** [May 22, 2024, 10:16am UTC](https://community.triggre.com/t/json-response-post-api/707/5 "2024-05-22T10:16:22Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/194f084b83883397c2fcd545bdd6e37d2da2e9b4.png)  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/1496a273a6bf6a7065bbd6141480eed0ef788f09.png)

---

<div class="post-metadata">

**Author:** ![Jesse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/jesse/32/88_2.png) [@Jesse](https://community.triggre.com/u/Jesse)\
**Post date:** [May 22, 2024, 10:18am UTC](https://community.triggre.com/t/json-response-post-api/707/6 "2024-05-22T10:18:46Z")

</div>

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!

**UPDATE**  
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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/367281c6ef0a1cef3dd636979e56e8a6918e707f.png) [@system](https://community.triggre.com/u/system)\
**Post date:** [May 25, 2024, 2:19pm UTC](https://community.triggre.com/t/json-response-post-api/707/7 "2024-05-25T14:19:41Z")

</div>

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