问题
For other APIs that I'm calling (including Analytics), it all seems to work fine, but when I try to make any Pull Request queries, I get a 403 Forbidden
.
The calls are being made by my private Windows agent with PAT authorised with all scopes. It is using @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"}
.
Is there some other permission I need to set somewhere?
Edit 1:
If I use $header = @{Authorization = "Basic <hard coded base64 encoded string used in the header for my Postman queries>"}
, it works.
回答1:
You need to grant Contribute to pull requests
permission to Project Collection Build Service (XXX)
user. (Version control admin page > Select a repository)
来源:https://stackoverflow.com/questions/49020015/getting-a-403-forbidden-when-calling-the-pull-request-api-on-vsts