As we all know EWS provide support for MessageClass can be used while searching emails having particular MessageClass value.
Does Graph API also support similar functionality for searching emails from user mailbox?
As we all know EWS provide support for MessageClass can be used while searching emails having particular MessageClass value.
Does Graph API also support similar functionality for searching emails from user mailbox?
Using $search on message collections, you can search messages based on a value in specific message properties. The results of the search are sorted by the date and time that the message was sent. A $search request returns up to 250 results.
Sample Request - https://graph.microsoft.com/v1.0/me/messages?$search="pizza" (GET)
Please refer to search parameter documentation to understand better.
Also, in addition to that, you can leverage Microsoft Search API to search Outlook messages.
Refer to Example 1 in documentation here for the same.
Let me know if this helps.
ItemClass isn't a first class property in the graph so if you want to use it in a Filter you need to use the singleValueExtendedProperties defination of the MAPI messageclass property and filter on that eg
https://graph.microsoft.com/v1.0/me/mailFolders('Inbox')/messages?$filter=singleValueExtendedProperties/any(ep:ep/id eq 'String 0x001a' and ep/value eq 'IPM.Note')
One pain point with the Graph is that it only lets you access particular MessageClass's and SubClass of those via the Messages endpoint.
Using Extended property, we can use Message Class to filter emails from mailbox store. Following link is very useful for them, who are planning to migrate EWS based application to Graph based.
https://gsexdev.blogspot.com/2020/03/migrating-your-mailbox-searches-in-ews.html