Extraction of identifier from uri path with a custom method

Hi apigee community!

I’m working an API Proxy with a custom method: POST - /entities/{idEntity}:search

My “proxy.pathsuffix” is /entity/1-2BC3:search when request sent, I explored the use of extract variable policy with a pattern:

EV-SetUriRequestVariables **/entities/{idEntity}:search** true request uriRequest

And the use of “%” to scape “:” character:

EV-SetUriRequestVariables **/entities/{idEntity}%:search** true request uriRequest

But both options results in:

uriRequest.idEntity = 1-2BC3:search

Can you help me to know anything else to do with the pattern option or isn’t possible to solve it, therefore I need to use a javascript policy ?

Best Regards.

I think you must resort to a JavaScript policy for that kind of extraction.