author | description | ms.date | title | ms.localizationpriority | ms.subservice | doc_type |
---|---|---|---|---|---|---|
spgraph-docs-team |
Retrieve the list of drive resources available for a target user, group, or site. |
09/10/2017 |
List drives |
medium |
sharepoint |
apiPageType |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Retrieve the list of drive resources available for a target user, group, or site.
[!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]
To list the document libraries for a group, your app requests the drives relationship on the Group.
GET /groups/{groupId}/drives
To list the document libraries for a site, your app requests the drives relationship on the Site.
GET /sites/{siteId}/drives
GET /users/{userId}/drives
GET /me/drives
This method supports the $expand
, $select
, $skipToken
, $top
, and $orderby
OData query parameters to customize the response.
If successful, this method returns a 200 OK
response code and collection of Drive objects in the response body.
The following example shows a request.
GET /me/drives
[!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]
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"id": "942CAEB0-13AE-491B-85E4-7557CDC0F25F",
"driveType": "documentLibrary",
"name": "Shared Documents",
"owner": {
"user": {
"id": "AE2A1EE9-81A7-423C-ABE4-B945F47509BB",
"displayName": "Ryan Gregg"
}
}
},
{
"id": "C1CD3ED9-0E98-4B0B-82D3-C8FB784B9DCC",
"driveType": "documentLibrary",
"name": "Contoso Project Files",
"owner": {
"user": {
"id": "406B2281-18E8-4416-9857-38C531B904F1",
"displayName": "Daron Spektor"
}
}
}
]
}
Most users only have a single drive resource.
Groups and sites may have multiple drive resources available.
Drives with the system facet are hidden by default.
To list them, include system
in your $select
statement.