Jeann Pierre
Jeann Pierre

Reputation: 131

Get and Filter Outlook events by Category using MS Microsoft Graph

am trying to filter Outlook events by category but am having trouble with the queries. I tried using the following queries but they return error messages.

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

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

I get the following output

"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.",

What's the proper syntax for this query? Does the graph even support filtering by Category for events? If so, is there any other way in which I can filter events by category?

thanks

Upvotes: 5

Views: 3154

Answers (1)

Marek Rycharski
Marek Rycharski

Reputation: 1704

Please use the following syntax: https://graph.microsoft.com/v1.0/me/events?$filter=categories/any(a:a+eq+'Red+Category')

Upvotes: 11

Related Questions