[英]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.