如何从Azure DevOps访问pagesBatch? [英] How can I access pagesBatch from Azure DevOps?
问题描述
这很好
curl -vsu ":${pat}" -XGET \
"https://dev.azure.com/${organization}/${project}/_apis/wiki/wikis/${project}.wiki/pages/20/stats?api-version=6.0-preview.1&pageViewsForDays=3"
,但以下内容为我提供了 HTTP 401 -使用相同的个人访问令牌:
but the following gives me an HTTP 401 - using the same personal access token:
curl -vsu ":${pat}" -d '{"top":5}' -XPOST \
"https://dev.azure.com/${organization}/${project}/_apis/wiki/wikis/${project}.wiki/pagesBatch?api-version=6.0-preview.1"
以下是前者并用于我是所讨论项目的管理员,所以我想这应该不是权限问题.那我在做什么错了?
I am admin of the project in question, so this should not be a permission problem, I suppose. So what am I doing wrong?
推荐答案
401错误响应表明未提供适当的授权,因此,基于该错误,您可以尝试创建一个新的PAT,并将其范围选择为
A 401 error response indicates that proper authorization was not provided, so base on the error, you can try to create a new PAT with the scope selected as full access
and try again.
我用邮递员测试了这个剩余的api,它工作正常.您还可以在邮递员中进行测试,以查看问题是否仅在使用curl时发生.
I tested this rest api with postman , it works fine. You can also test in postman to see if the problem only occurs when using curl.
这篇关于如何从Azure DevOps访问pagesBatch?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!