【问题标题】:Rest API for Azure devops calendar not workingAzure devops 日历的 Rest API 不起作用
【发布时间】:2022-01-01 14:34:22
【问题描述】:

我正在尝试使用下面的其余 api 在 azure devops 中获取日历数据:

https://extmgmt.dev.azure.com/{organisation}/_apis/ExtensionManagement/InstalledExtensions/ms-devlabs/team-calendar/Data/Scopes/Default/Current/Collections/{teamId}.{monthNumber}.{year}/Documents

我尝试了这个并替换为我的信息,但收到此消息:

{
   "$id":"1",
   "innerException":null,
   "message":"%error=\"16902\";%:The collection does not exist\r\n%error=\"16902\";%:The collection does not exist",
   "typeName":"Microsoft.VisualStudio.Services.ExtensionManagement.WebApi.DocumentCollectionDoesNotExistException, Microsoft.VisualStudio.Services.ExtensionManagement.WebApi",
   "typeKey":"DocumentCollectionDoesNotExistException",
   "errorCode":0,
   "eventId":3900
}

我只想要来自 azure devops 的日历事件。

【问题讨论】:

  • 您的用户有什么权限?您必须具有项目集合管理员权限才能在没有特殊扩展身份验证令牌的情况下读取任意扩展数据。您如何将身份验证令牌传递给您的呼叫?
  • 我正在使用获取请求,只需将 url 粘贴到浏览器中。我可以从 odata 查询中获取其他信息,您能否提供有关获取此数据的详细信息。

标签: azure azure-devops azure-pipelines azure-devops-rest-api azure-devops-extensions


【解决方案1】:

Azure devops 日历的 Rest API 不起作用

您需要确保 URL 中的组织名称正确。

我已经安装了扩展Team Calendar,添加一个事件进行测试。

然后我使用 REST API 来获取值:

https://extmgmt.dev.azure.com/{organisation}/_apis/ExtensionManagement/InstalledExtensions/ms-devlabs/team-calendar/Data/Scopes/Default/Current/Collections/{teamId}.{monthNumber}.{year}/Documents

{organisation}{teamId}{monthNumber}{year}替换为我的实际值:

【讨论】:

【解决方案2】:

尝试删除 URL 中的日期,然后像这样使用它:

https://extmgmt.dev.azure.com/{organisation}/_apis/ExtensionManagement/InstalledExtensions/ms-devlabs/team-calendar/Data/Scopes/Default/Current/Collections/{teamId}/Documents

不同版本的扩展程序之间的 API 似乎有所变化。

【讨论】:

  • 感谢您的回复,我在邮递员中使用我的 PAT 进行了尝试,但我得到 410 未经授权。你能不能从你这边试试,把截图和过程发给我。
猜你喜欢
  • 2021-04-20
  • 1970-01-01
  • 2020-06-12
  • 2022-07-17
  • 1970-01-01
  • 2020-07-06
  • 2021-04-19
  • 1970-01-01
  • 2020-11-26
相关资源
最近更新 更多