Reputation: 33
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
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.
Upvotes: 3
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
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