简体   繁体   中英

How to get subscriber ID of an API in Azure APIM?

我是Azure APIM的新手,想知道如何获取订户ID或可以唯一标识我的API的每个订户的任何内容。

You can use APIM management api to get the subscription ID. In your APIM Instance>Management API There you can find the management url and the token to call the endpoint can be generated.

Specifically to get all subscriptions, you can use below endpoint within management url : GET: https://{your management url}/subscriptions/?api-version=2018-01-01 Or specifically for a product

https://{your management url}/products/{productId}/subscriptions?api-version=2018-01-01

Below is the Rest API reference https://docs.microsoft.com/en-us/rest/api/apimanagement/subscription

Or within a APIM policy, you can find using context variables. https://docs.microsoft.com/en-us/azure/api-management/api-management-policy-expressions

context.Subscription.Id

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM