How to use filters in V7
Just as you are able to filter items in the UI, we now allow the ability to add filters when making queries via the REST API. These are added to the query params of the API request and include: item name, annotator, reviewer, workflow stage and more.
The filters allow you to make user of AND/OR in the query params to further enhance your request. Say you would like to retrieve a list of all images that have been annotated by the annotators with id 12 and 13 but not reviewed by the reviewer with id 15, you would make the following request:
import requests
url = "https://darwin.v7labs.com/api/v2/teams/team_slug/items?annotators=12&annotators=13¬_reviewers=15"
headers = {
"Accept": "application/json",
"Authentication": "ApiKey $API_KEY"
}
response = requests.get(url, headers=headers)
print(response.text)
Filters either take the form of query params (as in the above) or body payload (as in the example from itemization)
To see this in action, try out the list items API
Available for V2.0
Adding filters are query params is only available for v2.0 API. Reach out to our Support team if you would like help migrating from v1.0.