Search code examples
microsoft-graph-apionedrive

/v1.0/me/drive/search returns empty object for file field


When I search for DriveItems with the /v1.0/me/drive/search endpoint, items which are Files (e.g a .pdf) should be returned with a file resource in the file field according to the documentation. This file resource should contain the fields hashes and mimeType.

However, when I retrieve DriveItem results that are definitely files, I only receive an empty object in the file field. Is there something missing in my query or is this a bug.

The exact URL I am using to query is:

/v1.0/me/drive/root/search(q='test')?$select=webUrl,file,name,lastModifiedDateTime,createdBy,lastModifiedBy,createdDateTime,folder,image,id

Solution

  • Currently we don't return either the hash or the mimeType for search results. But I have made the change to atleast return mimeType. Hash is a harder fix and requires a bit of work. Thanks for bringing this to our attention. I will keep track of this issue and hopefully get to it in the near future.