question

YumihikoTsuzuki-8457 avatar image
0 Votes"
YumihikoTsuzuki-8457 asked MichaelHan-MSFT edited

How to get folders and files separately using graph drives API ?

I understand that the /children endpoint does not support the $filter parameter.
htps://docs.microsoft.com/en-us/answers/questions/501232/microsoft-graph-drive-filter-children-folder-file.html

Is there any way to get folder and file separately ?
From the application's performance point of view, it is crucial that we can get only files excluding folders.

It is possible to get only folder like this (but not supported).
GET https://graph.microsoft.com/v1.0/drives/{drive ID}/root:{folder path}:/children?filter=folder%20ne%20null

Getting file only doesn't work.
GET https://graph.microsoft.com/v1.0/drives/{drive ID}/root:{folder path}:/children?filter=file%20ne%20null

sharepoint-devmicrosoft-graph-files
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered YumihikoTsuzuki-8457 commented

Hi @YumihikoTsuzuki-8457,

Per my research, currently we cannot getting folders and files separately under a folder using Graph API.

You could submit the feature request in Microsoft 365 Developer Platform. They may take this into consideration.


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.





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dear @MichaelHan-MSFT,
thank you for your prompt answer.

I will submit the request about this issue to Microsoft 365 Developer Platform.

0 Votes 0 ·