I would like to get all the contents of a folder in OneDrive. The folder has child folders within it, and child folders within them, e.g.:
Parent/
└── Child1/
├── Child1.1/
│ ├── File1.1.1
│ └── File1.1.2
└── Child1.2/
├── File1.2.1
└── File1.2.2
I would like to maintain knowledge about folder hierarchy, basically something like Parent/Child1/File1.1.1
so I can't use the empty query graph search approach referenced here, which returns everything in a flat format without any information about the hierarchy.
I could recursively call each folder one by one but that would be a lot since there are thousands of folders in the parent directory.
Based on the docs (and here too), I would have expected the expand=children
parameter to work, but it seems not to. Any ideas?
GET https://graph.microsoft.com/v1.0/me/drive/items/<id>/children?$expand=children
{
"error": {
"code": "notSupported",
"message": "Operation not supported",
"innerError": {
"date": "2022-12-17T17:03:28",
"request-id": "",
"client-request-id": ""
}
}
}