About web_link in SharePoint's API for getting a list of folder file lists.

Ayase Morita 20 Reputation points
2025-02-03T06:28:15.04+00:00

https://learn.microsoft.com/ja-jp/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http

I would like to ask about the file property in the “GET /drives/{drive-id}/items/{item-id}/children” API response.

I would like to know all the files whose 'mimetype' in the file property is 'application/octet-stream'.

As far as I have tried, I believe that web links are applicable.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,949 questions
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,249 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 45,021 Reputation points
    2025-02-03T10:38:32.0766667+00:00

    Hi @Ayase Morita

    It seems that there is no support for using the API to directly get all files whose "mimetype" is "application/octet-stream". I suggest you use the Graph SDK locally to get the file set first and then filter the file set based on the file property.

        var files = await graphClient.Drives["{drive_id}"].Items["Root"].Children.GetAsync();
    
        foreach (var file in files.Value)
        {
            if (file.File != null && file.File.MimeType == "application/octet-stream")
            {
                Console.WriteLine(file);
            }
        }
    

    Hope this helps.

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


  2. Ayase Morita 20 Reputation points
    2025-02-03T11:17:52.65+00:00

    CarlZhao-MSFT

    Is there any mention in the official documentation of the type of file whose MimeType is application/octet-stream?

    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.