Share via

Is there any number restriction of sub folders in graph drives API ?

Yumihiko Tsuzuki 56 Reputation points
2021-10-20T08:34:48.37+00:00

When there exits 27 sub folders,
 /1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27
it is possible to get folder list in 27th sub folder like this.
GET https://graph.microsoft.com/v1.0/drives/{drive ID}/root:{folder path}:/children?filter=folder%20ne%20null

But it is failed to get folder list in 28th sub folder.
 /1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28
"error": {
"code": "UnknownError",
"message": "~~~The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.~~~",
"innerError": {
"date": "2021-10-20T01:45:10",
"request-id": "7e07f492-543b-4e3d-9348-492a25f55033",
"client-request-id": "7e07f492-543b-4e3d-9348-492a25f55033"

In this situation, if I use the {folder ID} not {folder path}, it works.
GET https://graph.microsoft.com/v1.0/drives/{drive ID}/items/{folder ID}/children?filter=folder%20ne%20null

Is there any number restriction of sub folders in graph drives API ?

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

  1. MichaelHan-MSFT 18,136 Reputation points
    2021-10-21T07:11:17.757+00:00

    Hi @Yumihiko Tsuzuki ,

    Per my test, I could reproduce this issue on my end. And when I add sites/{siteID} in the endpoint, like https://graph.microsoft.com/v1.0/sites/{siteID}/drives/{drive ID}/root:{folder path}:/children. The result is different, I could only get content in the 25th subfoler.

    Conclusion: Graph has number restriction for slash character(/) in the endpoint. And per my test the max number is about 30.


    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.



0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.