Path parameters are an essential component of RESTful APIs. They allow you to pass dynamic values directly within the URL, enabling APIs to identify specific resources or perform operations based on those values.
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.

PATH PARAMETERS :-
Path parameters are used when we need to make the parameter values mandatory.
Go to PRS_APIPARAMETERS-> Add operations for ‘APIParameters’-> Select GET Method & in the microflow create a new microflow(GetBookDataByPathParameters).

Now open your GetBookDataByPathParameters 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 Path parameters.
IMPORTANT :- When we use Path parameters we have to give the path for accessing the parameters with the help of this bracket {}.
Like in our case we have two parameters BookName & Price so give {BookName} for BookName & {Price} for Price but here we have to use parameter seperator(/) , So now our path will be {BookName}/{Price}.
We can also give the path like this BookName/{BookName}/Price/{Price} but this is not compulsory.
- 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}/{Price}

Remove the curly braces & pass the value in the path.
http://localhost:8082/rest/prsapiparameters/v1/APIParemeters/Mendix Lowcode 14/140

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