Search for files in the drive and return an empty array

Runxing Qiu 5 Reputation points
2024-09-11T07:21:52.23+00:00

Hello:

When I use the SDK to search for file requests, some accounts return empty data, but the file actually exists. But when I log in to the oneDrive in my browser and perform a search, the data comes back correctly, but after a while, about an hour or two, it doesn't work again. Here's my request link:

https://graph.microsoft.com/v1.0/me/drive/items/A42FA85F95CC1A8F!sea8cc6beffdb43d7976fbc7da445c639/microsoft.graph. search(q='video')

https://graph.microsoft.com/v1.0/me/drive/root/search(q='video')

Neither of the above requests will work. Unless I first sign in to OneDrive with this account in my browser and then make a search request. I noticed that the request in oneDrive used: https://api.onedrive.com/v1.0/drives/a42fa85f95cc1a8f/oneDrive.search(q=@s)?%40s=%27video%27&%24expand=thumbnails%2Ctags&select=*%2CwebDavUrl% 2Cocr

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,530 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.