使用 MS Microsoft Graph 按类别获取和过滤 Outlook 事件

Get and Filter Outlook events by Category using MS Microsoft Graph

我正在尝试按类别过滤 Outlook 事件,但遇到查询问题。我尝试使用以下查询,但它们 return 错误消息。

https://graph.microsoft.com/v1.0/me/events?$filter=startswith(Categories, 'test')

https://graph.microsoft.com/v1.0/me/events?$filter=contains(Categories, 'test')

我得到以下输出

"code": "BadRequest",
"message": "The argument for an invocation of a function with name 'contains' is not a single value. All arguments for this function must be single values.",

此查询的正确语法是什么?该图甚至支持按类别过滤事件吗?如果是这样,我可以通过其他方式按类别过滤事件吗?

谢谢

请使用以下语法: https://graph.microsoft.com/v1.0/me/events?$filter=categories/any(a:a+eq+'Red+Category')