Regarding the supported file formats in the GraphAPI file list retrieval API.

Ayase Morita 160 Reputation points
2025-03-03T10:41:33.7866667+00:00

Currently, I have made an API request to retrieve the list of files included in SharePoint using GraphAPI, but it has been confirmed that certain file formats are not included in the response.

API used: https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{folder-id}/search(q='xxx')

File formats confirmed to be included in the response: pdf, doc, docx, xls, xlsx, ppt, pptx

File formats confirmed not to be included in the response: tiff, tif, jpg, jpeg

I would like you to answer the following regarding this matter:

  • Is there an official document regarding the file formats that can be handled in the GraphAPI response?
  • Is the investigation result regarding the file formats not included in the aforementioned response correct?
  • Please tell me how to retrieve formats like tiff when using the file list retrieval API with a search query.
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.
3,386 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 39,371 Reputation points Microsoft External Staff
    2025-03-04T06:03:21.1633333+00:00

    Hi @Ayase Morita ,Per my test, I am unable to get tiff, tif, jpg, jpeg files by the search api. After doing some research, I didn't find any offical document about search api support file types. I only find some similar issues with yours for reference:

    https://learn.microsoft.com/en-us/answers/questions/702018/graph-api-search-for-driveitems-within-a-drive-doe

    As a workaround, you could use the api mentioned in the similar issue to get the files. And I would recomment you to use the following api to search the items

    Post https://graph.microsoft.com/v1.0/search/query  
    {
      "requests": [
        {
          "entityTypes": ["driveItem"],
          "query": {
            "queryString": "filename path:\"https://tenant.sharepoint.com/sites/sitename/Shared Documents\""
          }
        }
      ]
    }
    

    And here is the test result. I could get tiff, tif, jpg, jpeg files by the api

    User's image

    User's image


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

    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.


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.