Exposing Microflows as REST services.

0
  Hi,    What is the best method to expose a Microflow(s) as a REST service?   Regards
asked
2 answers
1

Hi Hayder,

The short answer: In the after startup flow of your mendix server, call microflow StartPublishServices followed by the CreateMicroflowService Java action, both are available in the RestServices module that can be downloaded from the Mendix app store.

 

Some more background information:

There is no built-in option in the Mendix modeler to expose REST services, see also the following forum post: https://forum.mendix.com/link/questions/86578

In order to expose a microflow as a REST service, you will need to import the RestServices module from the appstore. There is information available from Mendix on how to get you started: 

https://www.mendix.com/blog/rest-part-ii-publishing-microflows-rest/

https://github.com/mendix/RestServices/#publishing-rest-services

answered
3

Hi Hayder,

This depends on your Mendix version. Since version 6.6 (not 100% sure) you can do this natively with Mendix. For a step by step guide on how to do this please refer to https://docs.mendix.com/howto6/expose-a-web-service

If you happen to be running an older version of Mendix then you should take a look at the REST module for Mendix - https://appstore.home.mendix.com/link/app/997/

FInal note: if you are looking to only expose your data, not microflows, Mendix natively suports exposing your data via OData. This has been a feature since Mendix version 5.21 (again not 100% sure). For more details see https://docs.mendix.com/refguide/published-odata-services. OData is only partially integrated in Mendix though, allowing you to expose i.e. send data, but is NOT meant to receive data.

-Andrej

answered