Azure API 管理 Rest api 获取所有订阅密钥并抛出 400 错误代码

问题描述 投票:0回答:1

我正在尝试获取与任何 APIM 产品关联的所有订阅密钥名称。谁能为我提供正确的请求查询字符串?

curl --location 'https://gb-apim-dev.management.azure-api.net/subscriptions/b01ac92a-4fd4-9dc5-2506afa98816/resourceGroups/JLL-GB-RG-APIM-Dev/providers/Microsoft.ApiManagement/service/JLL-GB-APIM-Dev/subscriptions?%24filter=%7C%20name%20%7C%20ThoughtSpot-Trusted-Auth%7C%20eq%20%7C&api-version=2022-08-01' \ --header 'Authorization: SharedAccessSignature uid=integration&ex=2023-09-07T08:23:24.0288132Z&sn=fdfd+ggg=='

上面是我正在使用的卷发。我很难在查询字符串中传递正确的 $filter 语法。

$过滤器:|名称 | ThoughtSpot-Trusted-Auth|情商| - - 它是否正确 ? $过滤器:{|名称 | ThoughtSpot-Trusted-Auth| eq |} --- 这个?

我知道过滤器的语法是错误的,但无法从任何文章中获得任何帮助。

这是相关的微软文章。 https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/subscription/list?tabs=HTTP

azure odata azure-api-management
1个回答
0
投票

最初,您可以使用

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions?api-version=2022-08-01
URL 获取 APIM 实例中的所有订阅密钥。

enter image description here

您可以从上面的响应中获取

ownerId, scope, displayName, stateComment
属性,这些属性将在 $filter 参数中使用,如下所示 -

$filter=contains(properties/scope,'products/starter') 或 contains(properties/ownerId,'1') 和 contains(properties/displayName,'test_name')

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.