In this tutorial, you’ll learn how to publish REST services from your Mendix native mobile app. We’ll create an endpoint, expose it through REST, and test it step by step so your app can easily share data with external systems.
Go to MX Studio Pro Create a new module API.
Create an entity and add some sample data. For this tutorial, I’m using a Book entity with a few records.


Right click on API module -> Add other -> Published Rest Service & give the name PRS_GETAPI.

Now go to PRS_GETAPI-> add resources & give any name(GetApi).

Go to API module -> right click-> other->Click on Message Definition & give any name(MD_Book).

Open MD_Book(Message Definition) -> Click Add->Select your Book Entity & Check All attribute and click ok.

Go to again MD_Book(Message Definition) -> Select Book -> Click on Generate mapping to generate the export mapping and import mapping & click ok.

Now go to PRS_GETAPI-> Add operations for ‘GetApi’-> Select GET Method & in the microflow create a new microflow(GetBookData).

Now open your GetBookData microflow
1.Take a retrieve activity inside this microflow -> retrieve data from database -> select your Book entity.

2. Now return the BookList

Go to again PRS_GETAPI -> Open your GET operation -> Select your Export mapping(Book_Export) & Click OK.

Now run the application & test it.
Go to your PRS_GETAPI & Click on the link and Execute the API.


Conclusion:
I hope this article has helped you understand How to Publish REST APIs in Mendix Native.
Thanks for reading this! See you in the next blog post.
You can explore the complete Published REST API Series here.
