Hi,
I have a requirement to pass dynamic value in url as host**/basePath/operationName/AccountNumber?applicationId=a&SourceSystem=b** , where AccountNumber will always vary.
We have to add new operation in existing api proxy.
I have added a new conditional flow
(proxy.pathsuffix MatchesPath “/*/operationNaame/{AccountNumber}”) and (request.verb = “GET”)
and using extract variable policy
/operationName/{AccountNumber}/
and have used javascript
var host = context.getVariable(‘host-name’);
var opName = context.getVariable(‘operationName’);
var query= context.getVariable(‘request.querystring’);
var accNumber= context.getVariable(‘apigee.AccountNumber’); if(opName.includes(“operationName”))
{ opName=“operationName/{}”; resourcePath=“/basepath/”; }
else{ resourcePath=“existed basepath of previous operation/”; }
var targeturl = “https://”+host+resourcePath+opName+“?”+query;
context.setVariable(“target.url”, targeturl);
I am getting response but data is not reflecting that means getting null value.
please help me out.