REST API Service

0
Hi, I am trying to use the REST service functionality to retrieve data from my application. It works perfect within the local debugging mode. But if I am pushing the app, I am not able to query data from the defined REST API endpoint. I have tried to set several security options, without no improvement. I had the same behavior without authentication. Are further settings necessary? Regards, Ingo    
asked
4 answers
0

I tried to get data with the swagger ui and got a status code of 200. But an empty body.  

answered
0

Are you sure the API microflow is actually finding data to return? I would recommend turning on the debugger to see what's happening in that microflow.

 

https://docs.mendix.com/howto/monitoring-troubleshooting/debug-microflows-remotely 

answered
0

If you get a 200 with an empty body it may be that the cloud database is simply still empty.

You can always perform an empty check before you export whatever you are exposing. If no objects are found you can return a 204 – No Content. This gives a clear message to the user that the call was performed correctly (instead of returning a 400), yet theres simply no data to return.

Especially when you are allowing those calling your API to use query parameters (or something alike) it's a good indication that they are being too restrictive!

answered
0

Ok, the requested object is still empty. I have set a breakpoint. Maybe there is an issue to get the enum captions and keys with the MxReflection module. 

answered