Hi All,
I have a script that sends a PUT request to a user-defined API with an ID parameter to indicate which object I want to change. For example:
api/custom/radio/router/event/update?id=1f837456-4305-4208-b417-6e536986a1a7
However, when I try to retrieve the ID from the user-defined API, I cannot find a way to access it using the ApiTriggerInput object.
I tried using ApiTriggerInput.Parameters and ApiTriggerInput.Route, but neither of them returns the result I want.
Relevant documentation: https://docs.dataminer.services/dataminer/Functions/User-Defined_APIs/Defining_an_API/UD_APIs_Examples.html?q=ApiTriggerInput
Is there a way to retrieve the parameter from the request in a user-defined API?
Thanks!
Hi Jason,
You can access this like so:
requestData.QueryParameters.TryGetValue("id" /*your param name*/, out string paramValue);
Hi Ive,
It works. Thank you so much!