List all collections

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

Retrieves all collections for a given user.

Currently, only the favorites collection is supported.

Request

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 / int64in queryoptional
10001000-1000

The maximum number of items to return per page.

integer / int64in queryoptional
10000

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

Response

application/jsonCollections

Returns all collections for the given user

You can now try out some of our APIs live, right here in the documentation.
Log In

Request Example

cURL
curl -X GET https://api.box.com/2.0/collections \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollection<BoxCollectionItem> collections = await client.CollectionsManager.GetCollectionsAsync();
Java
Iterable<BoxCollection.Info> collections = BoxCollection.getAllCollections(api);
for (BoxCollection.Info collectionInfo : collections) {
	// Do something with the collection.
}
Python
collections = client.collections()
for collection in collections:
    print('Collection "{0}" has ID {1}'.format(collection.name, collection.id))
Node
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

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