Dani
Dani

Reputation: 33

How to chain APIs using Azure API management

How to chain multiple APIs on the same URL using Azure API management?

I have two APIs the user store and that user recources api.

I want to build rest api so resources will related to user.

Mycompany/users/[email protected]/resources.

User store api is mycompany/users Resources api is mycompany/resources.

I dont want to build additional service that will consolidate this two apis.

Thanks

Upvotes: 3

Views: 6827

Answers (3)

yuvraj
yuvraj

Reputation: 197

Additionally you can use 'send-request' policy, that will call another API endpoint and store the result in declared variable. This is what worked for me.

In my case I had hit another URL after getting response of first APIs. Same can be done in inbound policy also before getting response and similarly you can hit multiple APIs.

Policy snippet.

enter image description here

Upvotes: 3

Vandana Negi
Vandana Negi

Reputation: 91

I followed steps provided in this https://www.c-sharpcorner.com/blogs/api-aggregation-using-azure-apim link and able to combine two API responses within one API call.

It tells how to aggregate or chain more than one API responses in API management

Upvotes: 1

Darrel Miller
Darrel Miller

Reputation: 142014

You can create a single API in API Management that points to multiple different backend APIs. Use the set-backend-service policy to change the backend API for certain operations.

Upvotes: 2

Related Questions