Box Developer Documentation
Latest version

List all collections

get
https://api.box.com/2.0
/collections

This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

Retrieves all collections for a given user.

Currently, only the favorites collection is supported.

Request

bearer [ACCESS_TOKEN]
application/json

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

integer (int64)in queryoptional
1000
1000

The maximum number of items to return per page.

integer (int64)in queryoptional
1000
0

The offset of the item at which to begin the response.

Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.

Response

application/jsonCollections

Returns all collections for the given user.

application/jsonClient error

An unexpected client error.

get
List all collections
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versionig strategy.


cURL
curl -i -X GET "https://api.box.com/2.0/collections" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.collections.getCollections();
Python v10
client.collections.get_collections()
.NET v10
await client.Collections.GetCollectionsAsync();
Swift v10
try await client.collections.getCollections()
Java v4
Iterable<BoxCollection.Info> collections = BoxCollection.getAllCollections(api);
for (BoxCollection.Info collectionInfo : collections) {
	// Do something with the collection.
}
Python v3
collections = client.collections()
for collection in collections:
    print(f'Collection "{collection.name}" has ID {collection.id}')
.NET v5
BoxCollection<BoxCollectionItem> collections = await client.CollectionsManager.GetCollectionsAsync();
Node v3
client.collections.getAll()
	.then(collections => {
		/* collections -> { total_count: 1,
			entries: 
			[ { type: 'collection',
				id: '11111',
				name: 'Favorites',
				collection_type: 'favorites' } ],
			limit: 100,
			offset: 0 }
		*/
	});

Response Example

{
  "entries": [
    {
      "collection_type": "favorites",
      "id": "11446498",
      "name": "Favorites",
      "type": "collection"
    }
  ],
  "limit": 1000,
  "offset": 2000,
  "order": [
    {
      "by": "type",
      "direction": "ASC"
    }
  ],
  "total_count": 5000
}