How to check which attachment within the message matches the search

323 views Asked by At

I'm trying to search outlook's message attachments where search content exist, and I'm using this Search parameter to search over user's messages : https://learn.microsoft.com/en-us/graph/query-parameters#search-parameter.

But this api returns the details of the message where the search content exist, but does not specify the particular attachment within the message. I don't want to search on each attachment. goal is to search for the content from attachments from all the messages of the user and get the attachment details where search criteria meets.

This is the api call I'm using :

https://graph.microsoft.com/v1.0/users/<user-id>/messages?$search="abc"

I tried expending attachments with the search, but it returns all the attachments within this message, and not the one where the search content exist.

https://graph.microsoft.com/v1.0/users/<user-id>/messages?$search="abc"&$expand=attachments

I know there is another api for search on messages but it's in beta version : https://learn.microsoft.com/en-us/graph/search-concept-messages. I want an stable solution.

Thanks.

0

There are 0 answers