簡體   English   中英

Microsoft Graph API 在時間間隔內獲取日歷更改,按 lastModifiedDateTime 過濾

[英]Microsoft Graph API get calendar changes in a time interval, filter by lastModifiedDateTime

我試圖在特定日期之后在日歷中獲取修改或創建的事件。

  1. 按照文檔鏈接,我可以使用這個 url 來獲取今年的事件。

https://graph.microsoft.com/v1.0/me/calendarview?startDateTime=2020-01-01T00:00:00&endDateTime=2021-01-01T00:00:00

  1. 由於我只想在特定日期之后獲取修改或創建的事件,因此我嘗試使用過濾器和 lastModifiedDateTime 屬性,通過這種方式

https://graph.microsoft.com/v1.0/me/calendarview?startDateTime=2020-01-01T00:00:00&endDateTime=2021-01-01T00:00:00&$filter=lastModifiedDateTime%20gt%202020-10-01T00:00:00z

試圖獲取本月修改的事件,我得到一個空的響應,甚至沒有錯誤。

  1. 我也嘗試過這種方式文檔鏈接使用

https://graph.microsoft.com/v1.0/me/calendarView/delta?startDateTime=2020-01-01T00:00:00&endDateTime=2021-01-01T00:00:00&lastModifiedDateTime%20gt%202020-10-01T00:00:00z

但它返回當年的所有事件並且不按 lastModifiedDateTime 過濾。

有什么正確的方法可以在特定日期之后獲取修改或創建的日歷事件?

看起來 calendarView 不能與過濾器一起正常工作,一個可行的替代方法是過濾器列表事件, 文檔鏈接

工作網址如下所示: https://graph.microsoft.com/v1.0/me/calendar/events?$filter=lastModifiedDateTime%20gt%20" + date + "z" : https://graph.microsoft.com/v1.0/me/calendar/events?$filter=lastModifiedDateTime%20gt%20" + date + "z" $filter https://graph.microsoft.com/v1.0/me/calendar/events?$filter=lastModifiedDateTime%20gt%20" + date + "z"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM