API Proxy Chaining and consolidating responses

From a single API proxy,I need to call 3 API proxies and also combine the responses of the 3 proxies and send in a JSON. Could anyone share a sample of API Chaining involving 2 or more proxies ?

0 3 957
3 REPLIES 3

If you need to invoke more than one proxy, and you can't modify your existing proxies so that each calls the next one, you'll need to use Service Callouts before invoking the final backend proxy.

You should configure both your backend proxy and the service callout policy to use <LocalTargetConnection>

See

https://docs.apigee.com/api-services/content/connecting-proxies-other-proxies

and

https://docs.apigee.com/api-services/reference/service-callout-policy

Hi @Sriharsha Mohan

In order to achieve this you need to use 3 service callout policies to connect to three different API.

While you do so if the request for all these 3 api calls is same as the request that is passed to your api as input , then u can use the same by specifying the same request in Request payload in the Service Callout policy.

Define different variables save the response that comes from the service callout policy from these 3 api's . Then you can use the java script to fetch these 3 variables content and do the mashup and assign it to request.content again.

Kindly refer Service Callout policy doc for references.

Hope this helps.

Cheers

Ateeb



@deboraelkin - thank you and able to call internally 3 proxies