Hi everyone, I hope you’re all doing well.
I’d like to know if there is a simple way to define or retrieve a subpath from the request URL when triggering a User-Defined API, without having to create every route in the System Center page.
For example, I have created the route api/custom/devices, which returns device information from an element table. However, I would also like to have a route such as api/custom/devices/status, where only the current device’s status parameter is returned.
The idea was to avoid creating every route manually in System Center. Instead, we defined a single base route (e.g., /devices) and handled any requested subroutes (such as /devices/status) dynamically within the script.
Hi João,
You can have 1 user-defined script which contains multiple subroutes.
See example:

Thank you for your answer Matthias, i will try this method and get back to you if it works for me, that what i was looking for.
Hi João – are you trying to execute the same script and want it to return a different result based on the route? If so, you could instruct the script what to return (e.g., devices or status) in the body of the request.