简体   繁体   English

无法使用 REST API 列出 Azure 中的批准

[英]Cannot list Approvals in Azure using the REST API

I'm using the GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/approvals?api-version=7.1-preview.1 call I know that project and organization is correct, since I'm making other calls that work as expected.我正在使用 GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/approvals?api-version=7.1-preview.1调用我知道项目和组织是正确的,因为我正在拨打其他按预期工作的电话。 The above call should, according to the documentation list all the approvals, but I'm getting:根据文档列出所有批准,上述调用应该,但我得到:

Query for approvals failed.审批查询失败。 A minimum of one query parameter is required.\r\nParameter name: queryParameters.至少需要一个查询参数。\r\n参数名称: queryParameters。

I do not know that queryParameters I have to set, since the documentation does not dictate this for listing.我不知道我必须设置的 queryParameters,因为文档没有规定要列出这个。 Any ideas out there?有什么想法吗?

Test with the same Rest API and reproduce the same issue.使用相同的 Rest API 进行测试并重现相同的问题。

You need to add approvalIds to the Rest API URL then the API can run successfully.您需要将approvalIds添加到Rest API URL然后ZDB974238714CA8DE6FZACE可以成功运行。

For example:例如:

GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/approvals?approvalIds={approvalIds}&api-version=7.1-preview.1

To get the approvalid, you can use the Rest API: Timeline - Get要获得批准ID,您可以使用 Rest API: 时间轴 - 获取

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/timeline?api-version=6.0

You can get the approvalid in the response.您可以在响应中获得批准 ID。

在此处输入图像描述

The above call should, according to the documentation list all the approvals,上述调用应根据文档列出所有批准,

From your requirement, you need to list all approvals in the project.根据您的要求,您需要列出项目中的所有批准。 I am afraid that the Rest API not able to meet your requirement for the time being.恐怕Rest API暂时满足不了你的要求。

It only supports to return the Approvals defined in the Rest API URL.仅支持返回 Rest API URL 中定义的 Approvals。

Currently, this API is still in the preview status, and some functions may not be perfected.目前这款API还处于预览状态,部分功能可能还没有完善。

You can refer to and monitor this feedback ticket with the same question:https://github.com/MicrosoftDocs/vsts-rest-api-specs/issues/557您可以使用相同的问题参考和监控此反馈票:https://github.com/MicrosoftDocs/vsts-rest-api-specs/issues/557

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过 Azure DevOps Rest API 获得给定服务连接的批准和检查配置? - How do you get approvals and checks configuration for a given service connection via the Azure DevOps Rest API? REST API:使用REST API列出所有Azure ARM模板 - REST API : List all Azure ARM Templates using REST API 无法使用REST API和curl从Azure文件存储中检索文件列表 - Cannot retrieve file list from Azure File Storage using REST API and curl 使用REST API的Azure API管理的通知列表 - Notifications list for Azure API Management using REST API 如何使用 REST API 列出 azure 回购中内容的文件 - How to list the files with content that are in azure repo using REST API 使用带有 SharedAccessKey 的 Rest API 列出 Azure 服务总线的队列/主题 - List Queues/Topics of Azure Service Bus using Rest API with SharedAccessKey Azure SQL 数据库列表 - 服务器使用 REST API - List of Azure SQL databases - usage by server using REST API 如何使用REST API和Oauth2列出Azure VM? - How to list Azure VMs using the REST API with Oauth2? 如何使用REST Api在Windows Azure中列出管理证书 - How to list Management Certificate In windows azure using REST Api azure管道认证评论 - Comments on approvals in azure pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM