Get navigation tree

GET /navigation/trees/{tree_id}

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.

Path parameters

  • tree_id Required

    The navigation tree id, as returned by list navigation trees endpoint.

Query parameters

  • The max depth to be returned for the tree. By default the full tree will be returned.

  • Optional filters that will reduce the product population and only provide nodes with at least one product in it (for advanced usages only) Filter example: my-prop1~my-value

Responses

  • 200 application/json

    Successfully returned navigation tree content

    Hide response attributes Show response attributes object
    • status string
    • result object

      Additional properties are allowed.

      Hide result attribute Show result attribute object
      • Additional properties are allowed.

        Hide navigation_tree attributes Show navigation_tree attributes object
        • id string

          The unique id of the navigation tree

        • key string

          A key identifying the navigation tree, for debugging/understanding purpose, not guaranteed unique

        • Whether or not a product can be located in multiple nodes of the tree

        • max_depth integer

          The max depth requested. -1 if no depth limit has been applied

        • nodes array[object]
          Hide nodes attributes Show nodes attributes object
          • id string

            The id of the node, unique accross the navigation tree

          • The id of the parent node (empty for root nodes)

          • key string

            A key identifying the node, for debugging/understanding purpose, not guaranteed unique

          • name object

            Translations for the object. Available languages depend on your corporation settings

            Additional properties are allowed.

            Hide name attributes Show name attributes object
          • depth integer

            The depth of the node inside the tree

          • rank integer

            The ranking of the node accross its siblings

          • picto_urls array[url]

            The urls for the pictograms of this node (optional, not all nodes have pictograms)

  • 404 application/json

    Unknown navigation tree id

    Hide response attributes Show response attributes object
GET /navigation/trees/{tree_id}
curl \
 -X GET https://api.ppe-analytics.com/api/v1/navigation/trees/b1702cb8-b68e-47e5-a8fe-4a1b330d567f \
 -H "PPEApiKey: $API_KEY"
Response examples (200)
{
  "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
    }
  }
}
Response examples (404)
{
  "status": "ERROR",
  "message": "Unknown navigation tree id 'abcdef-1234'"
}