How can I invoke multiple target endpoints sequentially?

We need to design my API proxy such that it would call two target endpoints sequentially.


Usecase flow :-

Client calls API proxy-->API proxy calls TargetEndpoint1-->TargetEndpoint1 gives response-->API proxy works on TargetEndpoint1 response-->API proxy calls TargetEndpoint2-->TargetEndpoint2 gives response-->API proxy works on TargetEndpoint2 response-->API proxy gives response to Client

Please let me know how can we achieve this ?

Solved Solved
0 1 1,435
1 ACCEPTED SOLUTION

We can achieve this using one of the following ways:

Option #1

  1. Make the call to your target #1 via a Service Callout Policy.
  2. Process the response from the target #1.
  3. Make the call to your target #2 via the target endpoint.

Note: You can also use Javascript or Javacallout policy in step #1.


Option #2

  1. Have a NodeJS as the target server in your API Proxy.
  2. Within the NodeJS code,
    • Make the call to your target #1
    • Process the response from the target #1.
    • Make the call to your target #2

View solution in original post

1 REPLY 1

We can achieve this using one of the following ways:

Option #1

  1. Make the call to your target #1 via a Service Callout Policy.
  2. Process the response from the target #1.
  3. Make the call to your target #2 via the target endpoint.

Note: You can also use Javascript or Javacallout policy in step #1.


Option #2

  1. Have a NodeJS as the target server in your API Proxy.
  2. Within the NodeJS code,
    • Make the call to your target #1
    • Process the response from the target #1.
    • Make the call to your target #2