Adding additional properties to product or Subscription Key

Simran Bhagnani 1 Reputation point
2021-07-09T07:42:17.347+00:00

I have requirement in APIMS where every product is associated with a network ID and rather than allowing the User to fill the network Id via the developer portal, the system should be able to identify the networkId based on the context product ( which is known when User selects the subscription key) and pass it as a Template parameter in the request to the backend service

So the get endpoint has something like /api/{networkId}/network/junctions

and the Template parameter networkId gets prepopulated with the networkId associated with the product

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,728 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 22,061 Reputation points Microsoft Employee
    2021-07-09T19:19:12.397+00:00

    Hello @Simran Bhagnani , Thank you for reaching out.
    I think the requirement can be achieved by using policy expressions. You can fetch the subscription ID using context.Subscription variable and then map the known subscription ID with the required network ID. You can then use a suitable transformation policy to update the endpoint with the Network ID.
    Please let me know if there are any concerns. Thank you!

    0 comments No comments