我在使用MS Graph 1.0 calendarView
端点过滤日历事件时遇到问题。
我有一段代码,用于获取最近30分钟内修改的日历事件。这段代码使用calendarView
和$filter
(lastModifiedDateTime ge ...
)来查询Graph。
在某些时候它完全停止产生结果。没有错误。没有警告。只是一个空结果集。
最初,我提交的是RFC3339格式的时间戳,它工作正常。
lastModifiedDateTime eq ...
过滤器获取与API返回的时间戳完全相同的形式的事件,但不会返回任何匹配结果 // w/o filters there are visible results and there is clearly an event with a lastModifiedDateTime attribute set
// https://graph.microsoft.com/v1.0/users/sample@totallyfakecompany.onmicrosoft.com/calendarview?startdatetime=2017-02-15T11:33:06.775Z&enddatetime=2019-02-22T11:33:06.775Z
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('sample%40totallyfakecompany.onmicrosoft.com')/calendarView",
"value": [
{
"@odata.etag": "W/\"rVquutuYEk6b2WKuRzYB9QAAcVQDkg==\"",
"id": "AAMkAGViN2VkNDAxLWY2MzYtNGNiZi05NDEwLTdjNDRjNjA4YzYyNABGAAAAAADn5npXZZY1QrLh_blG0ZIaBwCtWq6625gSTpvZYq5HNgH1AAAAAAENAACtWq6625gSTpvZYq5HNgH1AABxVKXYAAA=",
"createdDateTime": "2018-09-12T13:54:02.8197636Z",
"lastModifiedDateTime": "2018-09-12T13:57:04.4596518Z" ...
// querying for a lastModifiedDateTime greater or equal the events attribute using the exact format of timestamp as the API returns an empty set
// https://graph.microsoft.com/v1.0/users/sample@totallyfakecompany.onmicrosoft.com/calendarview?startdatetime=2017-02-15T11:33:06.775Z&enddatetime=2019-02-22T11:33:06.775Z&$filter=lastModifiedDateTime ge 2018-09-11T13:57:04.4596518Z
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('sample%40totallyfakecompany.onmicrosoft.com')/calendarView",
"value": []
}
// querying for a lastModifiedDateTime equal the actual atrribute value also returns an empty set
// https://graph.microsoft.com/v1.0/users/sample@totallyfakecompany.onmicrosoft.com/calendarview?startdatetime=2017-02-15T11:33:06.775Z&enddatetime=2019-02-22T11:33:06.775Z&$filter=lastModifiedDateTime eq 2018-09-12T13:57:04.4596518Z */
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('sample%40totallyfakecompany.onmicrosoft.com')/calendarView",
"value": []
}
有人知道这里发生了什么吗?我可能丢失了某些东西,或者MS图中可能有所更改(很奇怪,因为API已版本化,而我仍使用相同的版本= 1.0)