1.c Get single classification and assignments

This page shows how to get the structure and assignments of a specific classification.

🚧

Assignments can be present at any level of the classification hierarchy.

Endpoints

/classifications/{code}/assignments

Supported methods
GET - returns the hierarchy for the specified classification with the assigned structure and documents.

import requests
import json

url = "https://{{instance}}.quable.com/api_1.php/classifications/{{classification_code}}/assignements"

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

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.
children A set of sub-classifications.
fields An object with classification attributes as keys and their values, depending on the given locale.
assignments An array of all documents assigned to the current classification.

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_ptp_355623217",
        "name": "CDI Prestashop - Racine",
        "level": 0,
        "active": true,
        "leaf": false,
        "created_at": "2019-03-27 12:37:01",
        "updated_at": "2020-12-21 16:34:41",
        "catalog_view_code": "ptp",
        "fields": {
            "quable_classification_name": "CDI Prestashop - Racine",
            "active": false
        },
        "children": [
            {
                "code": "out_0010",
                "name": "Boucherie",
                "level": 1,
                "active": true,
                "leaf": false,
                "created_at": "2019-03-27 16:42:59",
                "updated_at": "2020-12-10 17:06:33",
                "catalog_view_code": "ptp",
                "fields": {
                    "quable_classification_name": "Boucherie",
                    "quable_classification_description": "Découvrez nos viandes fraßches 100% origine France sous-vide et en barquette. Nous vous proposons des viandes de porc en direct de notre coopérative d'éleveurs ainsi que des viandes de boeuf, de veau et d'agneau. Elles accompagnent toutes vos envies et se dégustent de mille et une façons. ",
                    "quable_ordre_affichage": 1,
                    "quable_seo_metadesc": "Découvrez nos viandes fraßches 100% origine France sous-vide et en barquette. Nous vous proposons des viandes de porc en direct de notre coopérative d'éleveurs ainsi que des viandes de boeuf, de veau et d'agneau. Elles accompagnent toutes vos envies et se dégustent de mille et une façons. ",
                    "quable_seo_title": "Boucherie",
                    "url": null,
                    "active": true,
                    "quable_code_parent": "root_ptp_355623217",
                    "url1": "https://cdn.quable.com/myInstance/0010_Boucherie_Menu/original/boucherie.jpg",
                    "nom2": null
                },
                "children": [
                    {
                        "code": "out_0100",
                        "name": "Viandes",
                        "level": 2,
                        "active": true,
                        "leaf": false,
                        "created_at": "2019-03-27 16:42:59",
                        "updated_at": "2020-12-21 14:24:17",
                        "catalog_view_code": "ptp",
                        "fields": {
                            "quable_classification_name": "Viandes",
                            "quable_ordre_affichage": 1,
                            "quable_code_parent": "out_0010",
                            "quable_classification_description": "À griller, Ă  poĂȘler, Ă  rĂŽtir, Ă  mijoter...autant de façon de prĂ©parer nos viandes de boeuf, porc, veau et agneau. DĂ©couvrez notre sĂ©lection de viandes exclusivement françaises.",
                            "quable_seo_metadesc": "À griller, Ă  poĂȘler, Ă  rĂŽtir, Ă  mijoter...autant de façon de prĂ©parer nos viandes de boeuf, porc, veau et agneau. DĂ©couvrez notre sĂ©lection de viandes exclusivement françaises.",
                            "quable_seo_title": "Viandes",
                            "url": "https://cdn.quable.com/myInstance/0100_Viandes/original/viandes.jpg",
                            "active": true,
                            "url1": "https://cdn.quable.com/myInstance/0010_Boucherie_Menu/original/boucherie.jpg"
                        },
                        "children": [
                            {
                                "code": "out_1000",
                                "name": "Boeuf",
                                "level": 3,
                                "active": true,
                                "leaf": true,
                                "created_at": "2019-03-27 16:43:01",
                                "updated_at": "2020-12-10 17:06:34",
                                "catalog_view_code": "ptp",
                                "fields": {
                                    "quable_classification_name": "Boeuf",
                                    "quable_ordre_affichage": 1,
                                    "quable_code_parent": "out_0100",
                                    "quable_classification_description": "DĂ©couvrez nos piĂšces de boeuf de race Charolaise, tendres et savoureuses.",
                                    "quable_seo_metadesc": "DĂ©couvrez nos piĂšces de boeuf de race Charolaise, tendres et savoureuses.",
                                    "quable_seo_title": "Boeuf",
                                    "url": "https://cdn.quable.com/myInstance/1000_Boeuf/original/boeuf.jpg",
                                    "active": true,
                                    "url1": null,
                                    "nom2": null
                                },
                                "assignments": [
                                    {
                                        "id": "37207",
                                        "code": "01002976",
                                        "type": "document",
                                        "document_type_code": "produit",
                                        "active": "1",
                                        "links": {
                                            "self": "https://myInstance.quable.com/api_1.php/documents/01002976"
                                        }
                                    },
                                    {
                                        "id": "37206",
                                        "code": "01003004",
                                        "type": "document",
                                        "document_type_code": "produit",
                                        "active": "1",
                                        "links": {
                                            "self": "https://myInstance.quable.com/api_1.php/documents/01003004"
                                        }
                                    }
                                ],
                                "children": []
                            },
                            {
                                "code": "out_1001",
                                "name": "Porc",
                                "level": 3,
                                "active": true,
                                "leaf": true,
                                "created_at": "2019-03-27 16:43:01",
                                "updated_at": "2020-12-10 17:06:34",
                                "catalog_view_code": "ptp",
                                "fields": {
                                    "quable_classification_name": "Porc",
                                    "quable_ordre_affichage": 2,
                                    "quable_code_parent": "out_0100",
                                    "quable_classification_description": "Découvrez nos viandes de porc en direct de enotre coopérative d'éleveurs pour des plats gourmands et économiques.  ",
                                    "quable_seo_metadesc": "Découvrez nos viandes de porc en direct de enotre coopérative d'éleveurs pour des plats gourmands et économiques.  ",
                                    "quable_seo_title": "Porc",
                                    "url": "https://cdn.quable.com/myInstance/1001_Porc/original/porc.jpg",
                                    "active": true,
                                    "url1": null,
                                    "nom2": null
                                },
                                "assignments": [
                                    {
                                        "id": "37402",
                                        "code": "01003641",
                                        "type": "document",
                                        "document_type_code": "produit",
                                        "active": "1",
                                        "links": {
                                            "self": "https://myInstance.quable.com/api_1.php/documents/01003641"
                                        }
                                    },
                                    {
                                        "id": "46893",
                                        "code": "01004888",
                                        "type": "document",
                                        "document_type_code": "produit",
                                        "active": "1",
                                        "links": {
                                            "self": "https://myInstance.quable.com/api_1.php/documents/01004888"
                                        }
                                    }
                                ],
                                "children": []
                            }
                        ]
                    }
                ]
            }
        ]
    }
}