collection_controller = client.collection
CollectionController
Adds items to a collection.
def add_to_collection(self,
collection_id,
ids)
Parameter | Type | Tags | Description |
---|---|---|---|
collection_id |
uuid|string |
Template, Required | The collection id. |
ids |
List of uuid|string |
Query, Required | Item ids, comma delimited. |
void
collection_id = '0000055a-0000-0000-0000-000000000000'
ids = ['00000add-0000-0000-0000-000000000000', '00000ade-0000-0000-0000-000000000000']
result = collection_controller.add_to_collection(collection_id, ids)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Creates a new collection.
def create_collection(self,
name=None,
ids=None,
parent_id=None,
is_locked=False)
Parameter | Type | Tags | Description |
---|---|---|---|
name |
string |
Query, Optional | The name of the collection. |
ids |
List of string |
Query, Optional | Item Ids to add to the collection. |
parent_id |
uuid|string |
Query, Optional | Optional. Create the collection within a specific folder. |
is_locked |
bool |
Query, Optional | Whether or not to lock the new collection. Default: False |
is_locked = False
result = collection_controller.create_collection(None, None, None, is_locked)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Removes items from a collection.
def remove_from_collection(self,
collection_id,
ids)
Parameter | Type | Tags | Description |
---|---|---|---|
collection_id |
uuid|string |
Template, Required | The collection id. |
ids |
List of uuid|string |
Query, Required | Item ids, comma delimited. |
void
collection_id = '0000055a-0000-0000-0000-000000000000'
ids = ['00000add-0000-0000-0000-000000000000', '00000ade-0000-0000-0000-000000000000']
result = collection_controller.remove_from_collection(collection_id, ids)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |