Skip to content
This repository was archived by the owner on Nov 6, 2026. It is now read-only.

Latest commit

 

History

History
110 lines (74 loc) · 4.11 KB

collections.md

File metadata and controls

110 lines (74 loc) · 4.11 KB

CollectionsManager

Caution

box-python-sdk-gen is deprecated and no longer maintained. As of September 17, 2025, it receives no new features, bug fixes, or security patches. Do not use it for new projects.

Use box-python-sdk v10+ instead: pip install "boxsdk>=10". The equivalent of this page is box-python-sdk/docs/collections.md. To migrate existing code, see the migration guide.

List all collections

Retrieves all collections for a given user.

Currently, only the favorites collection is supported.

This operation is performed by calling function get_collections.

See the endpoint docs at API Reference.

client.collections.get_collections()

Arguments

  • fields Optional[List[str]]
    • 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.
  • offset Optional[int]
    • 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.
  • limit Optional[int]
    • The maximum number of items to return per page.
  • extra_headers Optional[Dict[str, Optional[str]]]
    • Extra headers that will be included in the HTTP request.

Returns

This function returns a value of type Collections.

Returns all collections for the given user.

List collection items

Retrieves the files and/or folders contained within this collection.

This operation is performed by calling function get_collection_items.

See the endpoint docs at API Reference.

client.collections.get_collection_items(favourite_collection.id)

Arguments

  • collection_id str
    • The ID of the collection. Example: "926489"
  • fields Optional[List[str]]
    • 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.
  • offset Optional[int]
    • 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.
  • limit Optional[int]
    • The maximum number of items to return per page.
  • extra_headers Optional[Dict[str, Optional[str]]]
    • Extra headers that will be included in the HTTP request.

Returns

This function returns a value of type ItemsOffsetPaginated.

Returns an array of items in the collection.

Get collection by ID

Retrieves a collection by its ID.

This operation is performed by calling function get_collection_by_id.

See the endpoint docs at API Reference.

client.collections.get_collection_by_id(collections.entries[0].id)

Arguments

  • collection_id str
    • The ID of the collection. Example: "926489"
  • extra_headers Optional[Dict[str, Optional[str]]]
    • Extra headers that will be included in the HTTP request.

Returns

This function returns a value of type Collection.

Returns an array of items in the collection.