Having trouble setting up the POST API request

0
Hi,    To give some context. I am retrieving data via an API Get request in my Mendix app. Now I want to change some of the data I retrieve and send it back via an API Post request.   For the Get request I created an import mapping with a JSON structure. I then created a microflow to call the REST service. This works fine and I retrieve the correct data.    The problem I am facing right now is to change the data I retrieve and sending it back via an API Post request.  I made an export mapping with the JSON structure I also used for the import mapping. I then created a new microflow with a Call REST (POST) activity and added the export mapping in the request header.        When I run my app and call the microflow I get the following 2 errors:    - An error has occurred while handling the request. [User 'Anonymous_ff2073b3-7133-40a9-bff5-fd40739a5920' with session id 'd2b60581-XXXX-XXXX-XXXX-XXXXXXXX294d' and roles 'Administrator'] -------- com.mendix.modules.microflowengine.MicroflowException: Error calling REST service     at RESTconsume.Microflow_2 (CallRest : 'Call REST (POST)') Advanced stacktrace:     at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79) Caused by: com.mendix.modules.microflowengine.MicroflowException: 500: Internal Server Error     at RESTconsume.Microflow_2 (CallRest : 'Call REST (POST)') Advanced stacktrace:     at com.mendix.integration.actions.microflow.RestCallAction.checkStatusCode(RestCallAction.scala:117)     - An error occurred while executing an action of MyFirstModule.Asset_Zoeken.actionButton2: Internal server error Error: An error occurred while executing an action of MyFirstModule.Asset_Zoeken.actionButton2: Internal server error     at http://localhost:8080/mxclientsystem/mxui/mxui.js?638190046759165854:68:147886     at we (http://localhost:8080/mxclientsystem/mxui/mxui.js?638190046759165854:24:6501)     at i (http://localhost:8080/mxclientsystem/mxui/mxui.js?638190046759165854:24:6402)     at x (http://localhost:8080/mxclientsystem/mxui/mxui.js?638190046759165854:66:5472)   Thanks!  
asked
1 answers
1

The error you are seeing is the external REST service you are calling returning an error. 

You can change the log level of the REST Consume node to TRACE to see the entire Request and Response in the console. This may give you a clue as to what is going wrong. It is probably incorrect data being sent from your Mendix application, so compare what you are sending to what the documentation says the service expects.

Good luck!

answered