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/{{channel_code}}/classifications

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:

code The classification's unique code.
name The classification's label in the current locale.
level The hierarchy level of the given classification.
fields An object with classification attributes as keys and their values, depending on the given locale.
children A set of sub-classifications.

URL Parameters

culture To specify the locale to use for the data retrieval.
classification_fields_included To include classification attributes. Possible values:
  • 0 - the attributes are not returned. (default)
  • 1 - the attributes are returned.
medias_included To include classification assets. Possible values:
  • 0 - the assets are not returned.
  • 1 - the assets are returned. (default)
media_fields_included To 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": []
            }]
        }]
    }
}