【发布时间】:2017-11-26 01:18:58
【问题描述】:
我无法根据传入的“apiId”从 REST API 检索 APIM 产品列表。我尝试使用下面屏幕截图中的 IDENTIFIER 值:
但是,我收到以下错误:
Invoke-RestMethod : {"error":{"code":"ResourceNotFound","message":"Api not found.","details":null}} 在 D:\powershell scripts\testing\test_add_api2.ps1:77 char:5 + Invoke-RestMethod -Method Get -Uri $url -Header @{ "授权 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-Rest 方法],WebException + FullyQualifiedErrorId:WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMet hodCommand
我正在使用以下路径来检索产品列表:
https://{base url}/apis/{apiId}?api-version=2016-10-10
我还验证了访问令牌的有效期为 5 天。
首先,我是否为“apiId”使用了正确的 ID?其次,如果我使用了正确的 apiId,最近路径是否发生了变化?
【问题讨论】:
标签: rest powershell azure azure-api-management