I am trying to extract a JSON variable and need some rudimentary help. The target is another ApiProxy which returns back a JSON body. However, when I run my ApiProxy (proxies/Gigya-Redux/develop/1) in Trace, the ExtractVariables never shows any extracted values. I’ve tried several variations of the JSONPath including the following (which all are valid JSONPath):
$.callId
$.results[0].lastUpdatedTimestamp
Any help would be appreciated.
The LocalTargetConnection returns this JSON in the body:
{
"callId": "2976aaf1fb184608ac9c9d2fc24f75ba",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2019-05-16T22:34:10.901Z",
"results": [
{
"lastUpdatedTimestamp": 1557859336355,
}
],
"objectsCount": 1,
"totalCount": 1
}
My ApiProxy looks like this:
<ProxyEndpoint name="default">
...
<PreFlow name="PreFlow">
<Request/>
<Response>
<Step>
<Name>EV-JSON-name</Name>
</Step>
</Response>
</PreFlow>
...
</ProxyEndpoint>
The ExtractVariables EV-JSON-name looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-JSON-name">
<Source clearPayload="false">response</Source>
<DisplayName>EV-JSON-name</DisplayName>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<JSONPayload>
<Variable name="name">
<JSONPath>$.callId</JSONPath>
</Variable>
</JSONPayload>
<VariablePrefix>apigee</VariablePrefix>
</ExtractVariables>