What is the best way for an outside app to link a specific product page done with Mendix?

0
I am building a web app with Mendix. I have a home page, e.g. mendixapp.com/index.html. I have product pages, e.g. mendixapp.com/product/{id} Let’s say these product each have a unique combination of two attributes: size and color. How can an outside app link to my mendix app using those two specific attributes? Do I have to create a REST API in my Mendix app that returns the ID of a product which has the two given attributes so that my outside app can create the URL to my Mendix app? From what I have seen, it is not really simple to retrieve the ID of an entity in Mendix, but what other choice do I have here? Would it be possible to create an URL like  mendixapp.com/product?size=L&color=Red ?
asked
2 answers
3

I would use the deeplink module for that. The only problem is that it only can handle two parameters currently. And I think the first parameter would be de productid. Now you could concenate the size and color in one string. You would then need to split that string back again to two different variables but that is doable. You could search for size- and color= for instance. See the string function call for substring etc.: https://docs.mendix.com/refguide/string-function-calls/ to help you with the string splitting.

 

Regards,

Ronald

 

answered
0

You also have the option of presenting a REST interface and then creating the required deeplink within that microflow. There is an example out there: https://github.com/mendix/RESTDeeplinkModule

(But be warned, it will break deeplink by default because it tries to route requests to the same `/link/` url)

answered