Skip to content

Latest commit

 

History

History
176 lines (126 loc) · 5.01 KB

File metadata and controls

176 lines (126 loc) · 5.01 KB
author spgraph-docs-team
description Retrieve the list of drive resources available for a target user, group, or site.
ms.date 09/10/2017
title List drives
ms.localizationpriority medium
ms.subservice sharepoint
doc_type apiPageType

List available drives

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Retrieve the list of drive resources available for a target user, group, or site.

[!INCLUDE national-cloud-support]

Permissions

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]

HTTP request

List the drives of a group

To list the document libraries for a group, your app requests the drives relationship on the Group.

GET /groups/{groupId}/drives

List the drives of a site

To list the document libraries for a site, your app requests the drives relationship on the Site.

GET /sites/{siteId}/drives

List the drives of a user

GET /users/{userId}/drives

List the current drives of a user

GET /me/drives

Optional query parameters

This method supports the $expand, $select, $skipToken, $top, and $orderby OData query parameters to customize the response.

Response

If successful, this method returns a 200 OK response code and collection of Drive objects in the response body.

Examples

Request

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]


Response

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"
        }
      }
    }
  ]
}

Remarks

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.