MS Graph Using multiple search paramenters

Viewed 14

I'm trying to use multiple search parameters, but every time I test it out in the Graph Explorer it seems to ignore the search parameters completely. Only if I have one search parameter does it work for that specific search, but I need to pull emails that have attachments and were received yesterday.

This is what I've been trying to get to work:

https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$search="hasAttachments:true" AND "received:yesterday"&$expand=attachments

What is the proper format to search for emails with attachments and received yesterday?

1 Answers

The whole search query should be inside quotation marks "hasAttachments:true AND received:received:yesterday"

Your search query is separated to "hasAttachments:true" and "received:yesterday"

Example:

https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$search="hasAttachments:true AND received:2022-09-15"&$expand=attachments
Related