Rest-doc Swagger UI returns 404 Resource not found on POST while the service is working nicely e.g. from Postman

Last week everything was fine but since my last builds the swagger UI of my app is returning 404 error “resource not found”. The rest service is up and running and works nicely with Postman… e.g. the POST to which is documented at If you want to test it out use the payload example below or replace the wrong apostrophes in the last line from the payload example in the rest-doc by the inchmark.  Is anyone experiencing similar issues or does anyone have a clue what I might have unconsciously changed?  Payload:  {    "functionalLocation": "313.61.ENC_CP53M01_ENC",    "fromDateTimeUTC": "2019-05-24T01:30:00",    "toDateTimeUTC": "2019-05-24T01:40:09",    "comments": "Postman test indicator kapot spoeltunnel"  } You could try it out in Postman with the settings from the image and Content-Type: application/json
3 answers

For me, it works, both in Postman and in the SwaggerUI.


My guess is that when you tried it, the app was down because it hadn't been used for a certain amount of time. Accessing the application in a browser will start it up, then the services will probably work again?


From the documentation:

“Without a licensed node you can still deploy your app and test it, however it will only run for a couple of hours before shutting down, cannot be scaled and has limited operational information available. “


“For a Free App, your app has a single Sandbox environment which allows you to test your app. However, this comes with restrictions on how long it will run.”


I think the REST API is confused because there is a Resource name that is equal to the service name (location). But if you run this locally you can set REST-Publish on trace and see what's logged.


in postman also 404 btw:


Thanks for your replies! Although neither of them was the proper answer, it has led me to the solution. The solution is use the swagger-authorize button to login.

 So thanks for getting me on the right track. 

  1. Last week the Mendix Swagger UI forced me to login if i wasn't already logged in. 
  2. Now it didn't
  3. So i tried to first login with the Swagger UI authorize button
  4. Then I did the post services again and now they were working nicely, no 404 :-)
  5. So the problem was in the authorization.
  6. Switched off “allow anonymous usage” and rebuild, now the Mx  Swagger UI automatically pops up the login 
  7. Switched on “allow anonymous usage” and rebuild, now the Mx Swagger UI does not pop up the login, instead throws a 404 when executing the ‘try out request’


So if you have anonymous usage allowed, the swagger UI will not automatically redirect you to the authorize action, but it will throw a 404. This is probably as designed.