When I use the $search param with a connected outlook grant, nylas throws an error stating that the $ is invalid. I don’t think my syntax is incorrect?
The issue is that $search is not a supported Microsoft Graph query parameter for the search_query_native parameter in Nylas API v3. The reason that using $search in the search_query_native is because this is not well supported in Microsoft and is often either ignored or returns partial result.
For Microsoft Graph accounts, you can use $filter queries in the search_query_native parameter. The documentation shows an example using $filter for Microsoft Graph:
The search_query_native parameter allows you to use provider-specific query strings for Google, Microsoft Graph, EWS, and IMAP accounts, but the query string must be URL-encoded and follow the specific syntax supported by each provider.
For Microsoft Graph, you should use $filter instead of $search. To search for messages from a specific email address, your query would be:
The issue is, if I need to search across the email body or recipients (not from, but to, bcc, and cc), it doesn’t seem like that is possible via this $filter param. Am I just not using this properly or is there no way to search/filter across email body on outlook emails?
Unfortunately, you cannot search email body content using Microsoft Graph through Nylas. This isn’t a limitation of Nylas, but rather a deliberate design decision due to reliability issues with Microsoft Graph’s search capabilities. Microsoft’s $search functionality has documented problems including:
Returning partial or inconsistent results
Sometimes ignoring search queries entirely
Unreliable behavior with compound queries
Recipient Search Limitations:
For recipient searching, your options with Microsoft Graph are limited to: