Extracting URI Path parameters as multiple arguments

Hi Team, 

When working with a url with URI path parameters such as https://sampleUrl/{arg1}/{arg2}/{arg3} is it possible to define the url on apigee as https://sampUrl/{...id} where the variable takes multiple arguments? To ease the process of URI path extraction using the JS policy?

1 3 214
3 REPLIES 3

is it possible to define the url on apigee as https://sampUrl/{...id} where the variable takes multiple arguments?

What do you mean by "define the url on Apigee"? What is your goal here?

To ease the process of URI path extraction using the JS policy?

I am not clear what your aim is. Can you give some examples, please?

Hi dchiesa1,

By this I am referring specifically to when setting the target URL, for a URL with multiple URI path parameters. Given that you need to extract the URI path parameters from the proxy endpoint and also you need to specify how many they will be on the proxy url e.g:

https//apigeeproxy/basepath/{id1}/{id2}

Is there a simpler way to define multiple URI path parameters, so in my case i am referring to defining a variable that can accept multiple parameters, like how javascript uses the spread operators , or python uses the args* argument.

If i were to use javascript for this case:

https://apiproxy/basepath/{multipleIDs...}

Regards

There is nothing in Apigee like python's args* argument.

I'm still not clear on what you REALLY want to do.  You say you want to extract url segments from a URL that has an indeterminate number of segments. but WHY are you doing this? 

Setting the target URL happens automatically. You don't need to extract parameters from the inbound URL in order to apply those to the target URL. The proxy. pathsuffix gets applied to the target URL you specify in the target.  The exception is if you want to change the target URL based on the individual values of the URL segments on the inbound URL. In that case, with some involved logic, I would recommend using JavaScript for that purpose.