cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Dynamic passing in REST API

Harsha3
New Contributor III

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?

image -Sample Rest

Sample harcoded API:

image

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

7 REPLIES 7

Deepti
New Contributor

Hi, Do we have any updates on this query? I have a similar use case and would really appreciate any input here. Thanks!

Harsha3
New Contributor III

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.

Deepti
New Contributor

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!