在VSTS上调用合并请求API时获取'403 Forbidden' [英] Getting a '403 Forbidden' when calling the Pull Request API on VSTS
问题描述
对于我打电话的其他API(包括Google Analytics),似乎一切正常,但是当我尝试进行任何Pull请求查询时,我得到 403 Forbidden
。
我的私人Windows代理正在使用所有范围授权的PAT进行调用。它使用 @ {Authorization =Bearer $ env:SYSTEM_ACCESSTOKEN}
。
是否有其他许可需要设置的地方?
编辑1:
如果我使用 $ header = @ {Authorization =基本的<在我的邮递员查询的标题中使用的硬编码的base64编码的字符串>}
,它的工作原理。
您需要将 Contribute拉到请求
权限授予 Project Collection构建服务(XXX)
用户。 (版本控制管理页面>选择存储库)
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.
You need to grant Contribute to pull requests
permission to Project Collection Build Service (XXX)
user. (Version control admin page > Select a repository)
这篇关于在VSTS上调用合并请求API时获取'403 Forbidden'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!