JSON Parse issue at REST POST Call

0
Team@ I am seeing below error while making Rest- API call(POST Method) at a microflow.  Any suggestion on this error please ?   Error parsing JSON. Unrecognized token 'Error': was expecting ('true', 'false' or 'null')  at [Source: (org.apache.http.client.entity.LazyDecompressingInputStream); line: 1, column: 7]     at MyFirstModule.CWS_Fetch_SampleOrders_SalesOrder_Details_Move1 (CallRest : 'Call REST (POST)')     at MyFirstModule.CWS_Fetch_SampleOrders_SalesOrder_Details (SubMicroflow : 'CWS_Fetch_SampleOrders_SalesOrder_Details_Move1') Advanced stacktrace:     at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:147) Caused by: Error parsing JSON. Unrecognized token 'Error': was expecting ('true', 'false' or 'null')  at [Source: (org.apache.http.client.entity.LazyDecompressingInputStream); line: 1, column: 7]     at com.mendix.integration.importer.json.JsonImporter.$anonfun$parseJson$2(JsonImporter.scala:58)     at com.mendix.integration.util.AutoCloseableUtil$.using(AutoCloseableUtil.scala:10)     at com.mendix.integration.importer.json.JsonImporter.$anonfun$parseJson$1(JsonImporter.scala:49)     at com.mendix.integration.util.AutoCloseableUtil$.using(AutoCloseableUtil.scala:10)     at com.mendix.integration.importer.json.JsonImporter.parseJson(JsonImporter.scala:48)     at com.mendix.integration.importer.json.JsonImporter.parse$1(JsonImporter.scala:37)
asked
2 answers
1

The raw JSON does not match the JSON structure your mapping is using.  It is not clear if this is the outgoing JSON or the response from the POST call.  However, in the Console tab in Studio Pro, you can select the Advanced menu and Set Log Levels.  Change the REST Consume node to Trace and you’ll see the the detailed outgoing and incoming JSON, which may help you to troubleshoot.

answered
0

For anyone dealing with this issue today. Noticed that when copying and pasting JSON structures from different applications (Teams or Word for example). It has a chance off adding some invisible characters to the structure. This will make your service fail. Noticed this when building a soap project for a rest call, I am working on. Thought I would note it here!

 

How I fixed this issue, either by beautify your file or type it in by hand!

answered