question

DarylDraper avatar image
0 Votes"
DarylDraper asked MichaelHan-MSFT commented

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

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?

sharepoint-devmicrosoft-graph-sites-listsmicrosoft-graph-search
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DarylDraper,

I am currently researching this issue, will update as soon as possible.

0 Votes 0 ·

Thanks for looking into it.

0 Votes 0 ·
MichaelHan-MSFT avatar image
1 Vote"
MichaelHan-MSFT answered DarylDraper commented

Hi @DarylDraper,

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is there any way for app to search for files using a part of the file name in a SharePoint site using the Microsoft Graph API, without granting access to all sites / site collections in the tenant?

0 Votes 0 ·
MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT commented

Hi @DarylDraper,

According to the documentation: https://docs.microsoft.com/en-us/graph/api/resources/search-api-overview?view=graph-rest-1.0#scope-search-based-on-entity-types. You need to grant at least Files.Read.All permission on your app to search files.


136632-image.png



image.png (71.7 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DarylDraper,
Is there anything update? I'm willing to hear from you.


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.*

0 Votes 0 ·