Muokkaa

Jaa


List bundles

Namespace: microsoft.graph

Get a list of all the bundles in a user's drive.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Not supported. Not supported.
Delegated (personal Microsoft account) Files.Read Files.ReadWrite, Files.Read.All, Files.ReadWrite.All
Application Not supported. Not supported.

HTTP request

GET /drive/bundles

Optional query parameters

This method supports the $filter OData query parameters to help customize the response.

You can't use the expand=children query parameter to list bundles.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

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

For information about error responses, see Microsoft Graph error responses and resource types.

Examples

Example 1: List all bundles in a drive

To request an enumeration of all bundles defined in the drive, you can make a request to the bundles collection without any parameters.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/drive/bundles

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

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

{
  "value": [
    {
      "id": "0123456789abc",
      "name": "Vacation photo album",
      "bundle": {
        "childCount": 1,
        "album": { }
      }
    },
    {
      "id": "0120310201abd",
      "name": "Family shared files",
      "bundle": {
        "childCount": 1
      }
    }
  ],
  "@odata.nextLink": "https://..."
}

Example 2: List all photo albums in a drive

To filter the list of bundles returned from a request to the bundles collection, you can use the filter query string parameter to specify the type of bundle to return by checking for the existence of a facet on the bundle.

Request

The following example shows a request.

GET https://graph.microsoft.com/v1.0/drive/bundles?filter=bundle/album%20ne%20null

Response

The following example shows the response. The response to a GET to the bundles endpoint is an array of driveItem resources with the bundle. Because all bundles are items, you can use all the standard item operations on them.

Note: The response object shown here might be shortened for readability.

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

{
  "value": [
    {
      "id": "0123456789abc",
      "name": "Vacation photo album",
      "bundle": {
        "childCount": 1,
        "album": { }
      }
    },
    {
      "id": "120301010abcd",
      "name": "Seattle Center event",
      "bundle": {
        "childCount": 4,
        "album": { }
      },
      "tags": [
        {
          "name": "outside",
          "autoTagged": { }
        }
      ]
    }
  ]
}