CollectionsModule

public class CollectionsModule

Management of collections of files and folders. The only collection available is the “Favorites”.

  • Retrieves the collections for the given user.

    Declaration

    Swift

    public func list(
        offset: Int? = nil,
        limit: Int? = nil,
        fields: [String]? = nil
    ) -> PagingIterator<BoxCollection>

    Parameters

    offset

    The offset of the item at which to begin the response. See offset-based paging for details. This parameter cannot be used simultaneously with the ‘marker’ parameter.

    limit

    The maximum number of items to return. The default is 100 and the maximum is 1,000.

  • Retrieve the favorites collection

    Declaration

    Swift

    public func getFavorites(fields: [String]? = nil, completion: @escaping Callback<BoxCollection>)

    Parameters

    fields

    The set of fields to retrieve on the resulting collection object

    completion

    Passed the favorites collection, or an error if the API call fails

  • Gets all of the files, folders, or web links contained within a collection.

    Declaration

    Swift

    public func listItems(
        collectionId: String,
        offset: Int? = nil,
        limit: Int? = nil,
        fields: [String]? = nil
    ) -> PagingIterator<FolderItem>

    Parameters

    collectionId

    The ID of the collection on which to retrieve information.

    offset

    The offset of the item at which to begin the response. See offset-based paging for details. This parameter cannot be used simultaneously with the ‘marker’ parameter.

    limit

    The maximum number of items to return. The default is 100 and the maximum is 1,000.

    fields

    Comma-separated list of fields to include in the response. Any attribute in the full file or folder objects can be passed in with the fields parameter to get specific attributes, and only those specific attributes back; otherwise, the mini format is returned for each item by default. Multiple attributes can be passed in separated by commas e.g. fields=name,created_at.