在calendarView上使用nextLink的Microsoft Graph API导致ErrorAccessDenied

时间:2020-08-05 14:36:08

标签: microsoft-graph-api microsoft-graph-sdks microsoft-graph-calendar

在CalendarView上进行增量查询,即使没有结果,我也会收到nextLink。

GET: https://graph.microsoft.com/v1.0/users/..../calendars/..../calendarView/microsoft.graph.delta?startdatetime=2020-08-05T13:53:29.954Z&enddatetime=2021-08-05T13:53:30.151Z

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(event)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/users/..../calendars/..../calendarView/microsoft.graph.delta?$skiptoken=b9658zLYx7ag_WbFCK2mQj8933PsHHOxsDcYSWymakIJAcGkjxjTZWz4SsQI4Gu31DvwMi0kzqDrERlfvpdkmD73Q-qUZHD5hyPpuGzImOd5KAY6SFhuYJTLnvcBRo31v2UIm9miIbAHDoaY4ImhmxMa8bmAUKOL....",
    "value": []
}

跟随该链接获得deltaLink会导致ErrorAccessDenied

GET: https://graph.microsoft.com/v1.0/users/..../calendars/..../calendarView/microsoft.graph.delta?$skiptoken=b9658zLYx7ag_WbFCK2mQj8933PsHHOxsDcYSWymakIJAcGkjxjTZWz4SsQI4Gu31DvwMi0kzqDrERlfvpdkmD73Q-qUZHD5hyPpuGzImOd5KAY6SFhuYJTLnvcBRo31v2UIm9miIbAHDoaY4ImhmxMa8bmAUKOL....

{
  "error": {
    "code": "ErrorAccessDenied",
    "message": "Access is denied. Check credentials and try again.",
    "innerError": {
      "date": "2020-08-05T14:06:37",
      "request-id": "fa8341c3-3eb0-4465-825e-6d7e80f532cd"
    }
  }
}

有什么我想念的吗? 如果没有返回对象,是否有办法在第一个请求上获取deltaToken?

我尝试使用msgraph-sdk-java 1.9.0并使用PostMan直接调用来实现此流程。

1 个答案:

答案 0 :(得分:1)

我已经尝试了几个小时,但是没有任何效果。...直到我们的客户最终仔细检查了他的配置并从头开始重新分配了所有委托权限。

现在它可以正常工作了。...