Query parameters are an essential component of RESTful APIs. They allow you to pass key-value pairs in the URL after a question mark (?
). These parameters help in filtering, sorting, and customizing the response from the API without altering the endpoint structure. By appending multiple query parameters separated by ampersands (&
), you can provide additional instructions to the API, making your data requests more precise and efficient.
First create the Mendix application in any version. Here, I am using 9.24.5
-> Open Mendix studio pro
-> Create new app
-> Select Blank web app
Go to MX Studio Pro and create an entity & give any name like “Book” & add your data.

Go to MX Studio Pro create a folder APIPARAMETERS-> right click on it-> click on other->Published Rest Service & give the name PRS_APIPARAMETERS.

Now go to PRS_APIPARAMETERS-> add resources & give any name(APIParemeters).

Go to APIPARAMETERS folder-> right click on it-> click on other->Message Definition & give the name MD_Book.

Go to MD_Book(Message Definition) -> Click on Add -> Select your Book entity & check all the attributes.

Navigate to MD_Book (Message Definition) -> Select Book -> Click on Generate Mapping and create both Import and Export mappings.

QUERY PARAMETERS :-
Go to PRS_APIPARAMETERS-> Add operations for ‘APIParameters’-> Select GET Method & in the microflow create a new microflow(GetBookDataByQueryParameters).

Now open your GetBookDataByQueryParameters microflow
- Take two parameters first string type(BookName) & second decimal type(Price).


2. Take a retrieve activity -> select your Book entity -> in the range select All -> in the Xpath pass this [BookName=$BookName and Price=$Price].

3. Now return the BookList.

Lastly, Go to PRS_APIPARAMETERS -> Open your GET/APIParameters -> Add two Query parameters.
- String Type(BookName) -> In the microflow parameter select BookName.

2. Decimal Type(Price) -> In the microflow parameter select Price.

3. After adding both parameters select your EXP_Book(Export mapping).

Now run the application & test it.

If you want to test this in POSTMAN
http://localhost:8082/rest/prsapiparameters/v1/APIParemeters?BookName={BookName}&Price={Price}


Conclusion:
I hope this article has helped you understand How to Implement Query Parameters in Mendix.
Thanks for reading this! See you in the next blog post.