query parameter not included in target

I am using an AssignMessage policy to add a query parameter to the request. The full configuration of the policy is below. When the flow gets to the target url, it does not add the query parameter. IN tracing the call, I see that the

target.basepath.with.query variable does not contain the query param.

I have confirmed that the {alexa.zip} variable exists and is correct.

Why isn't the query param being added to the target call?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageSetQueryParam">
    <DisplayName>AssignMessage.SetQueryParam</DisplayName>
    <Properties/>
    <Set>
        <Verb>GET</Verb>
        <QueryParams>
            <QueryParam name="zip">{alexa.zip}</QueryParam>
        </QueryParams>
    </Set>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="true" transport="http" type="request">request</AssignTo>
</AssignMessage>
0 7 1,166
7 REPLIES 7

Hi @Kevin Kohut

Can you confirm if you are not setting

context.setVariable("target.copy.pathsuffix", false);

anywhere in your code ?

I am not setting that anywhere. I can try to set to true explicitly. But this shouldn't have any impact on query params, correct? pathsuffix is a different entity than the query params, isn't it?

No - It basically removes any request URI in the proxy to the target.

In your Assign Message, can you please replace the AssignTo line with this

<AssignTo createNew="false" transport="http" type="request"/>

I did, same result.

HI @Kevin Kohut - Can you email me the bundle to ssvaidyanathan@apigee.com ? I would like to take a look at it

target.basepath /YelpSearch
target.basepath.with.query /YelpSearch
target.copy.pathsuffix true
target.copy.queryparams true

Not applicable

Hi @Kevin Kohut - I hope this issue got resolved. I also had similar issue and what I noticed is, explicitly added queryparams are getting removed after setting "target.url". So, to overcome this issue, I have to set "target.url" first and then assign query params (in a different assign message policy/JS).