Hi,
I have a Proxy which does a service call out to a get_oAuthToken service of the backend and gets a JSON Payload and stores it in a context variable "calloutResponse". how do i access the token variable in the JSON payload stored in the context variable. I have the below setup in my assignmessage policy.
<AssignMessage continueOnError="false" enabled="true" name="generateCustomResponse">
<DisplayName>generateCustomResponse</DisplayName>
<Set>
<Payload variableSuffix="@" contentType="application/json" variablePrefix="#">
{ "toke" : #calloutResponse.access_token@ }</Payload>
<Path/>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
Solved! Go to Solution.
Try an ExtractVariables policy before the assign message policy and then use the variables created in the assign message policy.
https://cloud.google.com/apigee/docs/api-platform/reference/policies/extract-variables-policy#json