How can I search by subject in all users' emails?

%3CLINGO-SUB%20id%3D%22lingo-sub-2439442%22%20slang%3D%22en-US%22%3EHow%20can%20I%20search%20by%20subject%20in%20all%20users'%20emails%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2439442%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20search%20mails%20in%20all%20users%20mailbox%20by%20subject.%20I%20am%20trying%20to%20use%20%22searchEntity%3A%20query%22%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fsearch-query%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fsearch-query%3Fview%3Dgraph-rest-1.0%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20be%20able%20to%20use%26nbsp%3B%22searchEntity%3A%20query%22%20i%20need%20this%20permissons%3A%26nbsp%3BMail.Read%2C%20Calendars.Read%2C%20Files.Read.All%2C%20Sites.Read.All%2C%20ExternalItem.Read.All%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20there%20is%20no%26nbsp%3BExternalItem.Read.All%20permission%20on%20azures%26nbsp%3Brequest%20api%20permissions.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Nocebo_0-1623419296486.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F288080iB696C33BA81E2ECF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Nocebo_0-1623419296486.png%22%20alt%3D%22Nocebo_0-1623419296486.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22jfk-bubble%20gtx-bubble%22%3E%3CDIV%20class%3D%22jfk-bubble-closebtn-id%20jfk-bubble-closebtn%22%3E1.%20How%20can%20i%20solve%20this%20issue%3C%2FDIV%3E%3CDIV%20class%3D%22jfk-bubble-closebtn-id%20jfk-bubble-closebtn%22%3E2.%20Is%20there%20another%20way%20to%20search%20mails%20in%20all%20users'%20emails%3F%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2439442%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Ignite%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2441675%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20search%20by%20subject%20in%20all%20users'%20emails%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2441675%22%20slang%3D%22en-US%22%3EExternalItem.Read.All%20is%20a%20delegate-level%20permission%2C%20you%20seem%20to%20be%20looking%20at%20the%20application-level%20ones.%20If%20your%20goal%20is%20to%20search%20mailboxes%2C%20I'd%20stick%20to%20the%20Mail%20API%20endpoints%20and%2For%20EWS.%3C%2FLINGO-BODY%3E
New Contributor

I am trying to search mails in all users mailbox by subject. I am trying to use "searchEntity: query": https://docs.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0

 

To be able to use "searchEntity: query" i need this permissons: Mail.Read, Calendars.Read, Files.Read.All, Sites.Read.All, ExternalItem.Read.All

 

But there is no ExternalItem.Read.All permission on azures request api permissions.

Nocebo_0-1623419296486.png

 

1. How can i solve this issue
2. Is there another way to search mails in all users' emails?
2 Replies
ExternalItem.Read.All is a delegate-level permission, you seem to be looking at the application-level ones. If your goal is to search mailboxes, I'd stick to the Mail API endpoints and/or EWS.
Or using compliance center and content search is the easiest way to search all mailboxes. Assuming you have the permission and access needed. But same goes for searching mailboxes any other way you need to access but with compliance center if you have the role you have access to search all boxes easily.