Düzenle

Aracılığıyla paylaş


drive resource type

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

The drive resource is the top-level object representing a user's OneDrive or a document library in SharePoint.

OneDrive users always have at least one drive available, their default drive. Users without a OneDrive license may not have a default drive available.

Methods

Method Return type Description
List drive drive collection Retrieve the list of drive resources available for a target user, group, or site.
Get drive drive Get metadata about a drive.
Get drive root driveItem Get root folder of a drive.
List activities itemActivity collection List activities that occurred under the drive.
List followed items driveItem collection List the user's followed driveItems.
List children driveItem collection List children of the root folder of a drive.
List changes driveItem collection List changes for all driveItems in the drive.
Search driveItem collection Search for driveItems in a drive.
Get special folder driveItem Access a special folder by its canonical name.

Properties

Property Type Description
createdBy identitySet Identity of the user, device, or application that created the item. Read-only.
createdDateTime dateTimeOffset Date and time of item creation. Read-only.
description String Provide a user-visible description of the drive. Read-write.
driveType String Describes the type of drive represented by this resource. OneDrive personal drives return personal. OneDrive for Business returns business. SharePoint document libraries return documentLibrary. Read-only.
id String The unique identifier of the drive. Read-only.
lastModifiedBy identitySet Identity of the user, device, and application that last modified the item. Read-only.
lastModifiedDateTime dateTimeOffset Date and time the item was last modified. Read-only.
name string The name of the item. Read-write.
owner identitySet Optional. The user account that owns the drive. Read-only.
quota quota Optional. Information about the drive's storage space quota. Read-only.
sharepointIds sharepointIds Returns identifiers useful for SharePoint REST compatibility. Read-only. This property isn't returned by default and must be selected using the $select query parameter.
system systemFacet If present, indicates that it's a system-managed drive. Read-only.
webUrl string (url) URL that displays the resource in the browser. Read-only.

Relationships

Relationship Type Description
activities itemActivity collection The list of recent activities that took place under this drive.
bundles driveItem collection Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive.
following driveItem collection The list of items the user is following. Only in OneDrive for Business.
items driveItem collection All items contained in the drive. Read-only. Nullable.
root driveItem The root folder of the drive. Read-only.
special driveItem collection Collection of common folders available in OneDrive. Read-only. Nullable.
list list For drives in SharePoint, the underlying document library list. Read-only. Nullable.

JSON representation

Here's a JSON representation of a Drive resource.

The drive resource is derived from baseItem and inherits properties from that resource.

{
  "activities": [{"@odata.type": "microsoft.graph.itemActivity"}],
  "id": "string",
  "createdBy": {"@odata.type": "microsoft.graph.identitySet"},
  "createdDateTime": "string (timestamp)",
  "description": "string",
  "driveType": "personal | business | documentLibrary",
  "following": [{"@odata.type": "microsoft.graph.driveItem"}],
  "items": [{"@odata.type": "microsoft.graph.driveItem"}],
  "lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"},
  "lastModifiedDateTime": "string (timestamp)",
  "name": "string",
  "owner": {"@odata.type": "microsoft.graph.identitySet"},
  "quota": {"@odata.type": "microsoft.graph.quota"},
  "root": {"@odata.type": "microsoft.graph.driveItem"},
  "sharepointIds": {"@odata.type": "microsoft.graph.sharepointIds"},
  "special": [{"@odata.type": "microsoft.graph.driveItem"}],
  "system": {"@odata.type": "microsoft.graph.systemFacet"},
  "webUrl": "string",

}