我尝试获取一个由
CalendarView
和 sensitivity
过滤的 lastModifiedDateTime
,但是当同时应用两个过滤器时,图形 API 会失败。如果我一次使用一个过滤器运行查询,它会按预期工作。通过测试,我发现是lastModifiedDateTime
导致了这个错误。
我找不到任何文档说,在
lastModifiedDateTime
上过滤时,仅支持一个过滤器。
我通过 Graph Explorer 运行查询。
失败的查询:
应用了 2 个过滤器,其中一个是
lastModifiedDateTime
https://graph.microsoft.com/v1.0/me/calendarview
?startdatetime=2018-10-28
&enddatetime=2018-10-30
&$filter=sensitivity eq 'normal' and lastModifiedDateTime ge 2018-10-29T00:00:00Z
失败并出现以下错误:
{
"error": {
"code": "ErrorInternalServerError",
"message": "An internal server error occurred. The operation failed.",
"innerError": {
"request-id": "<GUID>",
"date": "<DateTime>"
}
}
}
有效的查询:
单个过滤器打开
sensitivity
https://graph.microsoft.com/v1.0/me/calendarview
?startdatetime=2018-10-28
&enddatetime=2018-10-30
&$filter=sensitivity eq 'normal'
单个过滤器打开
lastModifiedDateTime
https://graph.microsoft.com/v1.0/me/calendarview
?startdatetime=2018-10-28
&enddatetime=2018-10-30&
$filter=lastModifiedDateTime ge 2018-10-29T00:00:00Z
2 个过滤器,但不是
lastModifiedDateTime
https://graph.microsoft.com/v1.0/me/calendarview
?startdatetime=2018-10-28
&enddatetime=2018-10-30
&$filter=importance eq 'normal' and sensitivity eq 'normal'
我希望有人可以帮助我,或者澄清为什么当涉及
lastModifiedDateTime
时它不能与多个过滤器一起使用。
我意识到这篇文章已经有 5 年历史了,但我想我应该回复一下,因为这里至少还有另一个 StackOverflow 问题。
有一个选项可以使用您的 Github 帐户报告问题,只需单击“?”在图形浏览器顶部栏中,然后单击“报告问题”。
我遇到的另一个问题是 select 语句包含您要过滤的字段之一。 Graph Explorer 将其标记为过滤器语句中的语法错误。我已通过 github 向 Microsoft 报告了这个问题。