Dynamically invoke multiple endpoints from an Azure APIM policy

I have a specific issue regarding Azure API Management.

My thing is that I am calling the back-end API from APIM. I need to provide a JSON scheme for my custom connector in Logic Apps / Flow.

Depending on the content of the response I receive, I need to make additional calls to ensure an enumeration / dropout.

Consider a response from an external API, for example:

{ "member1": { "prop": "content" }, "member2": { "prop": "content", "datasource": "http://someurl.com/api/member2/content" }, "member3": { "prop": "content" }, "member4": { "prop": "content" "datasource": "http://someurl.com/api/memberfour/content" } } 

I need to make extra calls for the URLs in the "data source" elements in order to provide additional data, but they are obviously dynamic, depending on what I'm doing. I am a bit stuck as I cannot execute a send-request policy for dynamic call count and URLs. What is the best way to approach this?

+5
source share
1 answer

If I understood the script correctly, I don’t think you want to use APIM to make calls to the URLs of data sources, because then you cannot return these results to logical applications. I think you are looking for x-ms-dynamic-values , which is documented here

You can use this extension to describe both the primary operation that provides your content and some secondary operations that will return the lists used to populate the drop-down lists for the Logic Apps interface. You may need to create additional APIM operations to add on these lists.

+1
source

Source: https://habr.com/ru/post/1273013/


All Articles