Hello all,
Graph API newbie here.
I am trying to search for messages in the body of the email.
I have tried the following and it did not work because it appears that filter cannot filter body of the email.
$upn = '******@domain.com'
$api = "https://graph.microsoft.com/v1.0/users/$upn/messages?filter=contains(subject,'XYZ') or contains(body/content,'XYZ')&count=true"
$api = "https://graph.microsoft.com/v1.0/users/$upn/messages?filter=contains(bodyPreview,'XYZ')&count=true"
So, I moved to use $search like below which just return all messages in the mailbox.
$api = "https://graph.microsoft.com/V1.0/users/$upn/messages?$search=subject:'XYZ'&count=true"
$api = "https://graph.microsoft.com/V1.0/users/$upn/messages?$search=bodyPreview:'XYZ'&count=true"
What did I do wrong?