MS Graph API如何检索已拒绝的日历事件?
获取已拒绝的日历活动解决方案
修改现有查询,添加过滤条件
默认情况下/me/events端点不会返回已拒绝的活动,你可以通过$filter参数指定包含responseStatus.response为declined的事件,结合时间范围的查询示例如下:https://graph.microsoft.com/v1.0/me/events?$filter=responseStatus.response eq 'declined' and start/dateTime ge '2023-01-11T23:00:01.000Z' and end/dateTime le '2023-01-12T23:00:00.000Z'如果需要同时获取未响应和已拒绝的活动,可使用
in操作符:https://graph.microsoft.com/v1.0/me/events?$filter=responseStatus.response in ('notResponded','declined') and start/dateTime ge '2023-01-11T23:00:01.000Z' and end/dateTime le '2023-01-12T23:00:00.000Z'关键点说明
原查询未返回已拒绝活动的原因是:Microsoft Graph的/me/events端点默认排除了已拒绝的事件,必须通过过滤条件显式声明要包含这类状态的事件。
内容的提问来源于stack exchange,提问作者Dominik Kapusta
相关产品推荐
相关产品推荐

