ExtractVariables is not working

Not applicable

My Uri is:

http://xxxxx.apigee.net/user/activate/oqTW1ZbKqqCgz592nKKUnaGQd5_r

My extract variable policy is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-GetStartDate">
    <DisplayName>EV-GetStartDate</DisplayName>
    <URIPath name="token" type="string">
        <Pattern ignoreCase="true">/{token}</Pattern>
    </URIPath>
    <VariablePrefix>queryinfo</VariablePrefix>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</ExtractVariables>

My assign message policy:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-AssigningDate">
    <DisplayName>AM-AssigningDate</DisplayName>
    <Set>
        <Payload contentType="application/json">
           {"token":"{queryinfo.token}","service":1}
        </Payload>
    </Set>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

my flow url is:

http://xxxxx.apigee.net/user/activate

my base url is:

http://xxxxx.apigee.net/user

I want to extract "oqTW1ZbKqqCgz592nKKUnaGQd5_r"

I am not getting any request payload while printing in logs.

0 4 199
4 REPLIES 4

Not applicable

Hi Preethi, can you please try giving the pattern as given below and give it a go.

<PatternignoreCase="true">/activate/{token}</Pattern>

I have tried that too.

Two things.

1. regarding your comment

I am not getting any request payload while printing in logs.

The extractVariables policy does not properly emit trace statements, when you use a variable prefix. This is a bug. It is being fixed, but may still affect your version.

2. The ExtractVariables MAY actually be working. If you are judging the correctness of its operation by the Trace output, you may be misled. Check the results of the AssignMEssage to be sure.

As per the EV doc, if the basepath for your API Proxy is /user then you need to include /activate/{token} in the Pattern .

<Pattern ignoreCase="true">/activate/{token}</Pattern>

Can you send me a api bundle for this path variable extraction?