使用Microsoft Graph API从最近24小时获取电子邮件

时间:2020-08-05 14:49:12

标签: outlook microsoft-graph-api

我正在尝试使用Microsoft graph API来获取过去24小时内收到的电子邮件。 目前,我正在使用以下请求网址:https://graph.microsoft.com/beta/me/messages

我目前收到最近10封电子邮件。为了获得最近24小时内收到的电子邮件,我该如何修改请求url?

1 个答案:

答案 0 :(得分:0)

您首先可以采用的两种方法是使用“过滤器”过滤接收日期大于搜索范围的邮件,例如

select c.emsfeaturecategory
from table1 c
join table2 f on c.ems_name = f.featurecategory

或者使用重新划分的关键字(今天,昨天等)进行搜索

https://graph.microsoft.com/beta/me/messages?Top=500&$filter=(receivedDateTime gt 2020-08-05T00:00:00Z)&Select=Subject,receivedDateTime