{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by Mj Patel · Jul 27, 2020 at 12:18 PM · 452 Views servicecallout

Newbie : Question on ServiceCall: using calloutResponse.content

Hello,

Newbie here, developing first proxy running into challenges in using response from ServiceCallout. Really appreciate any guidance you can provide here.

API1 : For example, Returns {"city":"London"} as response.

ServiceCallOut :

(a) is created to call API1,retrieve response (city value), proceed to get other information.

(b) "calloutResponse" is the response name of my serviceCallOut.

After serviceCallout is made to API1, trying extract city using extract variables policy using below snippet.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV_From_SC_MockTarget">
    <DisplayName>EV_From_SC_MockTarget</DisplayName>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <JSONPayload>
        <Variable name="IP_city">
            <JSONPath>$.calloutResponse.content.city</JSONPath>
            <!--<JSONPath>$.calloutResponse.content</JSONPath> -->
        </Variable>
    </JSONPayload>
   <Source>calloutResponse</Source>
</ExtractVariables> 

Behavior : Looks like no values getting assigned to IP_city variable in subsequent parts of the proxy. Rather getting empty value , like listed below. "IP_city": "",


Questions : Is above right way to trying to extract response from serviceCallout ?. Please note that i referred https://docs.apigee.com/api-platform/reference/policies/service-callout-policy, unable to use calloutResponse.content as listed.

Thank you

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0
Best Answer

Answer by Mj Patel · Jul 27, 2020 at 01:16 PM

Turns out that , i just need to below snippet. Just "$.city" is good enough ($.calloutResponse.content.city is unnecessary)

Issue is resolved now, able to proceed ...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV_From_SC_MockTarget">
    <DisplayName>EV_From_SC_MockTarget</DisplayName>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    <JSONPayload>
        <Variable name="IP_city">
            <!--<JSONPath>$.calloutResponse.content.city</JSONPath> -->
            <JSONPath>$.city</JSONPath>
        </Variable>
    </JSONPayload>
    <Source>calloutResponse</Source>
</ExtractVariables>
Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

71 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is there a timeout setting for the ServiceCallout policy in Apigee Edge? 2 Answers

servicecallout.{policy-name}.target.url returns null 1 Answer

Routerule in ServiceCallout 1 Answer

Is it possible to pass all incoming headers in requst via Service Callout ? 1 Answer

APIGEETOOL Error Uploading Service Callout Policy with causes a "beans.OtherValidationError" 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges