Skip to main content

Taxonomy API Documentation

Overview

Groups in Unwrap are organized into a hierarchical taxonomy, meaning some Groups can be parent of other Groups. The following documentation provides details on how to fetch the taxonomy structure so you can programmatically identify which Groups have parent/child relationships, and how deep in the taxonomy each Group is.

Fetching Entries

To fetch Entries from Unwrap's API, use the following GraphQL query:

query TeamGroupsTaxonomy($teamId: Int!, $filterInput: FilterInput!, $take: Int, $skip: Int) {
teamGroups(
teamId: $teamId
take: $take
skip: $skip
filterInput: $filterInput
) {
amountOfGroups {
amount
__typename
}
taxonomyTrees {
groupId
node {
...GroupTaxonomy
__typename
}
children {
groupId
node {
...GroupTaxonomy
__typename
}
children {
groupId
node {
...GroupTaxonomy
__typename
}
children {
groupId
node {
...GroupTaxonomy
__typename
}
children {
groupId
node {
...GroupTaxonomy
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
}

fragment GroupTaxonomy on Group {
id
title
uniqueEntries
totalDescendents
__typename
}

Example Variables

{
"teamId": {team_id},
"filterInput": {
"startDate": "2024-03-12T07:00:00.000Z",
"endDate": "2024-06-11T06:59:59.999Z"
},
"take": 1000,
"skip": 0
}

Response

{
"data": {
"teamGroups": {
"amountOfGroups": {
"amount": 401,
"__typename": "GroupsCount"
},
"taxonomyTrees": [
{
"groupId": 12345,
"node": {
"id": 12345,
"title": "Log in",
"uniqueEntries": 2871,
"totalDescendents": 27,
"__typename": "Group"
},
"children": [
{
"groupId": 23456,
"node": {
"id": 23456,
"title": "I'm unable to verify my identify",
"uniqueEntries": 1321,
"totalDescendents": 13,
"__typename": "Group"
},
"children": [
{
"groupId": 88778,
"node": {
"id": 88778,
"title": "I am having trouble uploading my ID",
"uniqueEntries": 176,
"totalDescendents": 2,
"__typename": "Group"
}
}
]
}
]
}
]
}
}
}