Undefined Error in REST API TEST call

1
Dear Mendix-Experts, I seem to be unable to make a POST call to a REST API work in Mendix. I tested the call as such using Postman, where I do get the expected response and no error. However, in Mendix I get an error (see log below) Can you spot the error on my API call?   Thanks in advance, this is driving me crazy Jonas   Postman:   Mendix API call (started via Call Microflow Button) 
asked
5 answers
3

Hi Jonas,

This is because you are having two curly brackets in the request body of REST call. Can you remove one curly bracket and try again?

 

Edit: Sorry your issue is not double braces, double braces are fine as mentioned in this post.

The issue is the API requires custom HTTP header. You need to add a custom HTTP header where key= Content-Type and value = ‘text/plain’. See the screenshot below and this should solve your issue. 

 

Hope this helps!

answered
1

The double bracket works in another case (pls. see below) and I read the double bracket is required to tell mendix that the following text is not a variable.

answered
1

That’s the error I get when using one opening bracket only:

answered
0

It looks like the template in Call REST has two opening brackets, when it only needs one.

I would just put {1} in the template, and instead set the JSON body as the parameter value.

answered
0

I do see a double {{ at the start of the template. Could that be it?

Regards,

Ronald

 

answered