JSON POST Errors

0
Hi All, I'm getting the following REST (POST) error:    Create Store Transfer on REST API call: Unexpected character ('O' (code 79)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')  at [Source: org.apache.http.client.entity.LazyDecompressingInputStream@2d8717f2; line: 1, column: 2] I've validated the JSON in 'postman' and it works: I've adjusted the Request and doubled on the curly brackets - and hardcoded it too - see below: {{"transfers": {{"data": {{"to_location_id": 30,"carton_qty": 1,"item_details": [{{"sku":108252378,"soh":33,"transfer_qty":0}}] }} }} }} However it doesn't work, does anyone have an idea - could it be a font format issue perhaps? Best Regards Adrian Full Error:
asked
5 answers
1

the {1} $RequestString is  not used in your template, so that can also have caused  the error.

My experience with this type of error can be solved by prepping the data in the parameter (in my case I needed \n for newlines).

 

You can also try to create  a mapping (based on a JSON  snippet) instead of a custom request template.

answered
0

You only need to use double braces ('{{') to escape the opening braces - for closing, you only use one closing brace '}' (see documentation here.)  This may solve your problem.

answered
0

Didn't work :(

I tried the following:

 

answered
0

Why don't you use the JSON structure and use an export mapping here? I think you shouldn't want to build such a "complex" JSON structure using a custom request template. See https://forum.mendix.com/link/questions/88895 for an example.

answered
0

I couldn't get the replaceall to work - I'll try the export mapping. Thanks for you help guys.

answered