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.
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.rnParameter name: queryParameters.
I do not know that queryParameters I have to set, since the documentation does not dictate this for listing.
Any ideas out there?
2
Answers
Test with the same Rest API and reproduce the same issue.
You need to add approvalIds to the Rest API URL then the API can run successfully.
For example:
To get the approvalid, you can use the Rest API: Timeline – Get
You can get the approvalid in the response.
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.
It only supports to return the Approvals defined in the Rest API URL.
Currently, this API is still in the preview status, and some functions may not be perfected.
You can refer to and monitor this feedback ticket with the same question: https://github.com/MicrosoftDocs/vsts-rest-api-specs/issues/557
PowerShell example based on Kevin Lu-MSFT’s answer: