我正在尝试使用 Microsoft graph API 获取过去 24 小时内收到的电子邮件。 目前我正在使用此请求网址:https://graph.microsoft.com/beta/me/messages
我目前收到了最后 10 封电子邮件。我如何修改请求 URL 才能获取过去 24 小时内收到的电子邮件?
首先可以采用的两种方法是使用过滤器来过滤接收日期大于搜索范围的邮件,例如
https://graph.microsoft.com/beta/me/messages?Top=500&$filter=(receivedDateTime gt 2020-08-05T00:00:00Z)&Select=Subject,receivedDateTime
或者使用保留关键字(今天、昨天等)进行搜索
https://graph.microsoft.com/beta/me/messages?search="received:yesterday"&Select=Subject,receivedDateTime&Top=250