Get navigation tree
Returns the content of a given navigation tree.
A navigation tree is a tree-structure to organize your products and navigate into them in a classic "nested folders" architecture.
It is very different from the navigation guide whose structure is dynamic and depends on the population considered and the answers chosen previously.
The depth of the tree is not fixed, and can vary accross a given tree depending on the branches.
Some trees allow for products to be found in multiple nodes, whereas some others will enforce a unicity constraint. This is detailed via the allow_multiple_nodes
attribute
For all the nodes with a parent_node_id
, the API guarantees that the parent node is returned before any of its children in the list, allowing a single-pass parsing of the tree.
curl \
-X GET https://api.ppe-analytics.com/api/v1/navigation/trees/b1702cb8-b68e-47e5-a8fe-4a1b330d567f \
-H "PPEApiKey: $API_KEY"
{
"status": "OK",
"result": {
"navigation_tree": {
"id": "b1702cb8-b68e-47e5-a8fe-4a1b330d567f",
"key": "website-tree-structure",
"nodes": [
{
"id": "the-essentials",
"key": "family~essentials",
"name": {
"en": "The essentials",
"fr": "Les essentiels"
},
"rank": 0,
"depth": 1,
"picto_urls": [
"https://app.ppe-analytics.com/static/pictos/300w/fc6d75d7-8366-424e-b526-4bc333a390b5.jpg",
"https://app.ppe-analytics.com/static/pictos/150w/e32e0f84-7889-414d-ab17-3be2d1f47f9a.jpg"
]
},
{
"id": "on-sales",
"key": "family~on-sales",
"name": {
"en": "On sales!",
"fr": "Les promos"
},
"rank": 1,
"depth": 1,
"picto_urls": [
"https://app.ppe-analytics.com/static/pictos/300w/fc6d75d7-8366-424e-b526-4bc333a390b5.jpg"
]
},
{
"id": "our-selection",
"key": "family~our-selection",
"name": {
"en": "Our selection",
"fr": "Notre selection"
},
"rank": 2,
"depth": 1
},
{
"id": "indoor-work",
"key": "env~indoor",
"name": {
"en": "Indoor work",
"fr": "Travail en intérieur"
},
"rank": 0,
"depth": 2,
"parent_node_id": "the-essentials"
},
{
"id": "outdoor-work",
"key": "env~outdoor",
"name": {
"en": "Outdoor work",
"fr": "Travail en exterieur"
},
"rank": 1,
"depth": 2,
"parent_node_id": "the-essentials"
},
{
"id": "outdoor-work-cold",
"key": "env-outdoor-temp~cold",
"name": {
"en": "Cold environment",
"fr": "Environnement froid"
},
"rank": 0,
"depth": 3,
"parent_node_id": "outdoor-work"
},
{
"id": "outdoor-work-hot",
"key": "env-outdoor-temp~hot",
"name": {
"en": "Hot environment",
"fr": "Environnement chaud"
},
"rank": 1,
"depth": 3,
"parent_node_id": "outdoor-work"
}
],
"max_depth": -1,
"allow_multiple_nodes": true
}
}
}
{
"status": "ERROR",
"message": "Unknown navigation tree id 'abcdef-1234'"
}