Question

I'm new in apigee. I need to configure proxy that make mass callout. I have a JSON on request like:

{
  ....
  "ETA": 10,
  "Price": 50,
  "Range": 10,
  "Record": "false",
  "Phones": [ "phone1","phone2","phone3","phone4","phone5","phone6"]
}

I need to making call with same parameters for each phone. Target endpoint is in the same app. I make custom .js that gets phones and make a call through httpClient.post but not sure that it is best way. (in this document http://apigee.com/docs/gateway-services/content/best-practices-api-proxy-design-and-development warring about ServiceCallout from one API proxy to another in the same organization, or recursively from an API proxy back to itself) In any tips about how to do it in a right way?

Was it helpful?

Solution

AFAIU, your first req to Twilio API will fetch you a list of phone numbers and then you got to place calls to the phone numbers one by one and you want this to work sequentially.

Why dont you use nodejs for this? Apigee Edge supports APIs developed in NodeJs. You can use modules like async.js to achieve what you need.

OTHER TIPS

My suggestion is to look at the API design itself. If its mass callout, I would build the target endpoint to accept all data at once. This saves the network roundtrips for each call and the latency.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top