02-05-2021 09:07 AM
Hi ,
I was trying to invoke the REST API dynamically . Let me share my requirement , I have on REST API in place which gives certain information of each country with respect to the country_id . Each country_id is unique , so instead of placing the country_id all the time in a pipeline , I thought of getting it done by passing it from pipeline execute . However it throws error . Is there only a way to achieve this is by using query parameters?
-Sample Rest
Sample harcoded API:
In the place of CID highlighted in yellow we have different unique values . Can I know is there any way to achieve this dynamically instead of changing that unique value every time after the previous execution .
Thanks
07-05-2023 12:55 AM
Hi, Do we have any updates on this query? I have a similar use case and would really appreciate any input here. Thanks!
07-05-2023 01:45 AM
Hi Deepti,
Actually, in my case, I passed the country Id as a parameter to the child pipeline. I prepared a sheet (excel) containing the list of countries and the corresponding country Id. I loaded the sheet in the child pipeline’s file reader. In the parent pipeline, I specified all those countries in the ‘;’ separated format, so that during each run, the countries are passed into the child pipeline one by one.
Then I used the mapper and specified the REST API path. According to my use case, each time we need to change the country ID in the REST API depending on the upcoming country fed by the parent pipeline and this can be achieved using the normal mapping function.
07-05-2023 03:22 AM
Thanks, Harsha, for your response, but I didn’t really get the ‘;’ separated part you mentioned for the parent pipeline. Would it be possible for you to provide a pipeline snapshot for me to relate to in a better way? Thanks again!