APIGEE Extensions returns response as com.apigee.flow.Variables@XXXXXXXXX

kirankoona
Participant I

I'm working on APIGEE Extensions( GCS, Firebase, Stackdriver). I can successfully POST and DELETE documents data from Firebase. I'm facing issues while retrieving data from Firebase and GCS. Response returned as "com.apigee.flow.Variables@18f41b8a". Debugged through trace and JavaScript(to check response stored on <Output> variable).

Any help or pointers would be greatly appreciated.

Solved Solved
0 4 622
1 ACCEPTED SOLUTION

Extension response objects are in JSON format. There are two options for how the policy handles the JSON:

  • Parsed (default): <Output>variable-name</Output> The policy parses the JSON object and automatically generates variables with the JSON data. For example, if the JSON contains "messageId" : 12345; and you name your output variable extensionOutput, you can access that message ID in other policies using the variable {extensionOutput.messageId}.
  • Unparsed: <Output parsed="false">variable-name</Output> The output variable contains the raw, unparsed JSON response from the extension. (If you wanted to, you could still parse the response value in a separate step using the JavaScript policy.)

https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#output_attributes

View solution in original post

4 REPLIES 4

Extension response objects are in JSON format. There are two options for how the policy handles the JSON:

  • Parsed (default): <Output>variable-name</Output> The policy parses the JSON object and automatically generates variables with the JSON data. For example, if the JSON contains "messageId" : 12345; and you name your output variable extensionOutput, you can access that message ID in other policies using the variable {extensionOutput.messageId}.
  • Unparsed: <Output parsed="false">variable-name</Output> The output variable contains the raw, unparsed JSON response from the extension. (If you wanted to, you could still parse the response value in a separate step using the JavaScript policy.)

https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#output_attributes

<Output parsed="false"> resolves the issue. Couple of months back without parsed=false used to work. Thanks alot @akhimich

Correct Kiran, that was Alpha release running and we made a change in GA release.

Please update the documentation for the PubSub extension here: https://docs.apigee.com/api-platform/reference/extensions/google-cloud-pub-sub/google-cloud-pub-sub-...

I have left a page comment as well.

The current samples are incorrect. They use the exact same variable name in the <Output> tag as in the <AssignVariable/> <Payload/> tags. This resulted in me scratching my head for 20 minutes trying to figure out what was wrong.

The sample needs to be updated to using <Output>topic.response</Output> and then in the <AssignVariable/> <Payload/> tag using the topic.response.messageId variable.