Learn how to send DELETE requests from your Mendix app using microflows and REST calls. In this guide, we’ll delete records via API and handle responses effectively.
Dependencies:-
You can find the published API endpoint URL below. For a better understanding of how this API was created, please refer to the previous article linked above.
http://localhost:8082/rest/prsdeleteapi/v1/DeleteApi?BookName={BookName}
Go to MX Studio Pro & Create a microflow ACT_DeleteBook.
Go to ACT_DeleteBook
1.Create a string variable & pass the BookName for search a Book object.
I am adding static value you can add dynamic according to your need.
Important:- We have to replaceAll white spaces with %20 Otherwise, the API request may fail or return a 400 Bad Request
error.

2. Take a Call REST Service activity -> Under General tab pass your endpoint URL & select HTTP method(DELETE).
Make sure to replace the {BookName} with {1} & in the parameter pass your previously created $BookName
http://localhost:8082/rest/prsdeleteapi/v1/DeleteApi?BookName={1}


3. Lastly, Take a Call microflow button on home page & select this microflow.

Now run the application & test it.
Important: Since you’re using two different Mendix applications — one to publish the API and another to consume it — make sure the application where the API is published on localhost is running before making any API calls from the other app. If the publishing app isn’t running, the API request will fail.


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