Using Sites.Selected search or query for a specific file name in a subfolder within a specific library.

DarylD 1 Reputation point

I have tried a variety of http get requests. With sites.selected permissions on an Azure App I can drill to a specific file name to retrieve its url, but I can't use a wildcard to find it, unless I know the exact subfolder it is in.

Is there a way to use Microsoft Graph Sites.Selected permissions perform a search or query for a part of a file name inside a sharepoint site and within subfolders?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,383 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,802 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MichaelHan-MSFT 18,021 Reputation points

    Hi @DarylD ,

    Per my test, when using Microsoft Graph Sites.Selected permissions search a file with the search api, we will get access dennied error.
    So Sites.Selected permission is not enough to seach a file. You need to grant at least Files.Read.All to searh a file in the site

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. MichaelHan-MSFT 18,021 Reputation points

    Hi @DarylD ,

    According to the documentation: You need to grant at least Files.Read.All permission on your app to search files.