过滤掉拒绝的事件

Filter out declined events

我需要使用 Microsoft Graph api,更详细地说是日历,来检索用户的一些事件(最多 1000 个条目)。 我需要过滤掉用户拒绝的事件。 该信息存储在 assignee 资源中,或者方便地存储在 'responseStatus' 属性.

我遇到的问题是,无论何时我尝试检索受让人资源,查询都需要 10 倍的时间来执行(从没有受让人的 1.2 秒到有受让人的 12-14 秒)。 (https://graph.microsoft.com/v1.0/me/events?select=id,subject,start,end,sensitivity,assignee&top=1000)

所以我尝试改为获取 responseStatus 并且......你猜怎么着,性能总是最差 10 倍 (https://graph.microsoft.com/v1.0/me/events?select=id,subject,start,end,sensitivity,responseStatus&top=1000)

然后我决定尝试直接过滤它们 (https://graph.microsoft.com/v1.0/me/events?select=id,subject,start,end,sensitivity,responseStatus&top=1000&filter=responseStatus/response ne 'declined'),但我收到一条错误消息,指出“属性 'responseStatus' 不支持过滤。”。 =14=]

而且我很难过滤受让人资源。

那么...是否有一种简单的方法来过滤拒绝的事件而不会出现此类性能问题?

您可以使用扩展的 属性 pidlidresponsestatus https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidresponsestatus-canonical-property 过滤掉那些,例如

https://graph.microsoft.com/v1.0/me/events?$select=subject,body,bodyPreview,organizer,attendees,start,end,location,responsestatus&$filter=singleValueExtendedProperties/any(ep:ep/id eq 'Integer {00062002-0000-0000-C000-000000000046} Id 0x8218' and cast(ep/value, Edm.Int32) ne 4)