Share via

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

Yumihiko Tsuzuki 56 Reputation points
Oct 20, 2021, 8:34 AM

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

Accepted answer
  1. MichaelHan-MSFT 18,126 Reputation points
    Oct 21, 2021, 7:11 AM

    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 Answers by the question author, which helps users to know the answer solved the author's problem.