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

Jea*_*rre 2 outlook office365 microsoft-graph-api

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

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

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

我得到以下输出

"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.",
Run Code Online (Sandbox Code Playgroud)

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

谢谢

Mar*_*ski 8

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

  • 我不知道如何获得未分类的电子邮件,有什么想法吗?另外,a:a 有什么作用? (2认同)