Get metadata for a drive on OneDrive

Use the OneDrive API to get metadata for a user's drive using an identifier.

You can identify a drive using any of the following identifiers:

  • To access any drive, a drive ID returned from the id property on the drive resource, or the driveId property of a ItemReference resource.
  • To access a user's default OneDrive, you can use the user's UPN (email) or User ID (guid).

HTTP request

GET /drives/{drive-id}

Path parameters

Parameter name Value Description
drive-id string Required. The identifier for the drive requested.

Optional query parameters

This method supports optional query string parameters to shape the response.

Request body

Do not supply a request body with this method.

HTTP response

If successful, this method returns a Drive resource for the matching drive in the response body.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "0123456789abc",
  "owner": {
    "user": {
      "id": "12391913bac",
      "displayName": "Ryan Gregg"
    }
  },
  "quota": {
    "total": 1024000,
    "used": 514000,
    "remaining": 1010112,
    "deleted": 0,
    "state": "normal"
  },
  "driveType": "personal"
}

Note: The Response object is truncated for clarity. All default properties will be returned from the actual call.

Error response

See Error responses for more info about how errors are returned.