Hello,
I am trying to filter emails by multiple categories with Microsoft Graph, but I'm not able to get it to work. I found this thread which gives me a query to filter by category 1 OR category 2:
https://learn.microsoft.com/en-us/answers/questions/666330/microsoft-graph-api-filtering-on-categories
$filter=categories/any(a:a eq 'Orange Category') OR categories/any(b:b eq 'Red Category')
I also found this thread which has the exact same problem as I do.
https://learn.microsoft.com/en-us/answers/questions/1418833/microsoft-graph-filter-messages-by-categories?source=docs
Here's the query they use:
$filter=categories/any(a:a eq 'Orange Category') AND categories/any(b:b eq 'Red Category')
Just as in that thread, I tried a similar query, and it just yields an empty array. It does not seem to work, and the link to a related GitHub issue is dead.
Here's the query I used in Graph Explorer that yields an empty array:
https://graph.microsoft.com/v1.0/me/messages?$filter=categories/any(a:a+eq+'__One')+AND+categories/any(b:b+eq+'_Two')
My mailbox has mails with category __One, mail with category _Two, mail with both categories, and mail with none or only the category "_Three".
What is wrong in my query and how can I filter emails by multiple categories with Microsoft Graph?
Thanks in advance for the help.