Getting empty response while search an excel files in OneDrive

Hari 6 Reputation points
2024-05-22T12:41:02.9766667+00:00

Hi,

We are using the 'Search for DriveItems within a Drive' API to search for a particular file across the entire OneDrive. While using this API, we are receiving an empty response from Microsoft. We get the correct search results for some accounts, but this issue only occurs for certain users.

Sample API Request

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

Sample API Response

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.driveItem)",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive/root/microsoft.graph.search(q=<key>)?$select=audio,bundle",
    "value": []
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,005 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,110 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hitesh Pachipulusu - MSFT 1,985 Reputation points Microsoft Vendor
    2024-05-22T15:06:18.5566667+00:00

    Hello @Hari,

    Thank you for contacting Microsoft Support.

    I have tried the same Graph API call in my tenant and able to fetch the details in the response using Graph Explorer.

    drive search

    Please ensure that you are using correct permissions provided in the documentation.

    As you mentioned the issue only occurs for limited users, can you check whether the users drive consists of any '.xlsx' files. If no items are found, the API will return an empty collection.

    If there are '.xlsx' files in drive and still you are getting empty response, I would recommend you raise a support case with Microsoft Graph, a Support Engineer will be able to look into this issue and assist you better. You can raise support ticket from New support request - Microsoft Entra admin center or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

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.