Itemization

Description of the itemization development in V7

As a part of the changes in v2.0 of the API, we have added greater ability to filter when using the API which we call itemization. Itemization allows greater flexibility in working with items without them necessarily being a part of the same dataset.

As an example, imagine you would like to like to archive all items with 'error' status and that have a comment. Instead of having to send a request for each dataset, you can now achieve this with a single request.

import requests

url = "https://darwin.v7labs.com/api/v2/teams/team_slug/items/archive"

payload = {"filters": {
        "dataset_ids": [1234, 2345, 3456],
        "statuses": ["error"],
        "has_comments": True
    }}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "ApiKey Q7ufHdH.KoT4CbW9fw_kJj3f-JzzoBhzp-ois3_q"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Note that this is across the entire team without any need to reference datasets explicitly.

📘

Items Assigned to Datasets

This doesn't alter the structure of where items are stored within Darwin. All items will still always be assigned to datasets within V7 on upload/registration.