Hi we are using IBM Api Connect as a gateway for our api's, i am unable to figure out how to make query params optional, i tried doing it in the DESIGN and ASSEMBLE sections of IBM api connect, but no luck.
this is my final URL that i want to invoke www.testdomain.products/getProducts?param1 = " "& param2 = " " & param3 = " "
here all the params are optional i am giving this url as
www.testdomain.products/getProducts?param1=$(request.parameters.param1)¶m2=$(request.parameters.param2) & param3=$(request.parameters.param3)
in one use case i am only passing param1, and want the final url to be constructed only with param1 but this is what i am seeing
www.testdomain.products/getProducts?param1="value"¶m2=¶m3=
what should i do so that the url is constructed with only the values that i am passing, like this
www.testdomain.products/getProducts?param1="value"
This can be achieved by creating the dynamic target URL using a script rather than setting static backend service URLin invoke/Proxy action.
Assembly section
Get GatewayScript Action before invoke
In Invoke/Proxy - Use this
$(target-url)
There might be some syntax issue, but we can achieve using the above way. Thanks!