When you use https://graph.microsoft.com/v1.0/me/messages?$search="body:#resolved", the API is likely treating #resolved as a special syntax, hence returning no results. When you percent encode the # tag: https://graph.microsoft.com/v1.0/me/messages?$search="body:%23resolved", the API ignores the # tag and returns all mail with “resolved” in the body.
Using Graph API to search email body content for string that has a hash
Paul Hawkes
0
Reputation points
I am searching an inbox looking for the term "#resolved" in the body of the email - I would like an exact match for the search string.
I have used this :https://graph.microsoft.com/v1.0/me/messages?$search="body:#resolved" This GET request will return nothing.
If I percent encode the # tag: https://graph.microsoft.com/v1.0/me/messages?$search="body:%23resolved" then this GET will return all mail with "resolved" in the body ignoring the # tag.
What should I be doing to just return the emails that have #resolved in their body?