author | description | ms.date | title | ms.localizationpriority | ms.subservice | doc_type |
---|---|---|---|---|---|---|
spgraph-docs-team |
Return a collection of driveItems in the children relationship of a driveItem. |
09/10/2017 |
List children of a driveItem |
medium |
sharepoint |
apiPageType |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Return a collection of driveItems in the children relationship of a driveItem.
DriveItems with a non-null folder or package facet can have one or more child driveItems.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
GET /drives/{drive-id}/items/{item-id}/children
GET /groups/{group-id}/drive/items/{item-id}/children
GET /me/drive/items/{item-id}/children
GET /sites/{site-id}/drive/items/{item-id}/children
GET /users/{user-id}/drive/items/{item-id}/children
This method supports the $expand
, $select
, $skipToken
, $top
, and $orderby
OData query parameters to customize the response.
Header name | Value | Description |
---|---|---|
if-none-match | etag | If this request header is included and the eTag (or cTag) provided matches the current tag on the file, an HTTP 304 Not Modified response is returned. |
To retrieve files in the root of the drive, use the root
relationship on the drive, then access the children relationship.
GET /me/drive/root/children
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
To retrieve files in the root of the drive, use the root
relationship on the drive, then access the children relationship.
GET /drives/{drive-id}/items/root/children
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
GET https://graph.microsoft.com/beta/drives/{drive-id}/root:/{path-relative-to-root}:/children
If successful, this method returns the list of items in the children collection of the target item. The children collection is composed of driveItem resources.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{"name": "myfile.jpg", "size": 2048, "file": {} },
{"name": "Documents", "folder": { "childCount": 4} },
{"name": "Photos", "folder": { "childCount": 203} },
{"name": "my sheet(1).xlsx", "size": 197 }
],
"@odata.nextLink": "https://..."
}
Note: If a collection exceeds the default page size (200 items), the @odata.nextLink property is returned in the response to indicate more items are available and provide the request URL for the next page of items.
You can control the page size through optional query string parameters.
See Error responses for more info about how errors are returned.