1.a Get classification hierarchy

This page shows how to get the hierarchy structure of all classifications. It does not include any assignments.

Endpoints

/catalog-views/

Supported methods GET - Returns the channel's entire hierarchy.

import requests
import json

url = "https://{{instance}}.quable.com/api_1.php/catalog-views/{{channel_code}}/classifications?classification_fields_included=1&culture=fr_FR"

payload={}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{token}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response

HTTP Header

200

JSON Body

success
true if all went well, otherwise false.

response
An array containing the classification hierarchy. The response is recursively composed of:

codeThe classification's unique code.
nameThe classification's label in the current locale.
levelThe hierarchy level of the given classification.
fieldsAn object with classification attributes as keys and their values, depending on the given locale.
childrenA set of sub-classifications.

URL Parameters

cultureTo specify the locale to use for the data retrieval.
classification_fields_includedTo include classification attributes. Possible values:
  • 0 - the attributes are not returned. (default)
  • 1 - the attributes are returned.
medias_includedTo include classification assets. Possible values:
  • 0 - the assets are not returned.
  • 1 - the assets are returned. (default)
media_fields_includedTo include classification asset attributes. Possible values:
  • 0 - the attributes are not returned. (default)
  • 1 - the attributes are returned.
{
    "success": true,
    "response": {
        "code": "root",
        "name": "E-commerce View",
        "level": 0,
        "children": [{
            "code": "eco_clothes",
            "name": "Clothes",
            "level": 1,
            "children": []
        }, {
            "code": "eco_furnitures",
            "name": "Furnitures",
            "level": 1,
            "children": []
        }, {
            "code": "eco_shoes",
            "name": "Shoes",
            "level": 1,
            "children": [{
                "code": "eco_shoes_women",
                "name": "Women",
                "level": 2,
                "children": []
            }, {
                "code": "eco_shoes_men",
                "name": "Men",
                "level": 2,
                "children": []
            }]
        }]
    }
}