Category characteristics blocks


API documentation for working with category characteristic blocks

Table with field descriptions:

Field Type Required? Description
id int No Unique identifier of the category characteristics block (required when updating).
category_id int Yes A unique identifier of the category to which the characteristics block belongs.
name_ro string Yes The name of the characteristics block in Romanian.
name_ru string Yes The name of the characteristics block in Russian.
name_en string No Name of the characteristics block in English.
name_uk string No The name of the block of characteristics in Ukrainian.
hide boolean Yes Indicates whether the characteristics block is hidden (true/false).
specifications array[ Object{ "id": int }] Yes An array of characteristics containing characteristic identifiers (id) that are part of this block for the selected category.

1. Getting all blocks of characteristics for categories

Method: GET
URL: {domain}/external/category-characteristic/

Description:
Returns a list of all site category property blocks.

Query example:

GET {domain}/external/category-characteristic/

Example answer:

[
    {
        "id": 75,
        "category_id": 27,
        "name_ro": "Generalewer",
        "name_ru": "Generale",
        "name_en": null,
        "name_uk": null,
        "hide": true,
        "specifications": [
            {
                "id": 8
            },
            {
                "id": 9
            },
            {
                "id": 13
            }
        ]
    }
]

2. Receiving one block of characteristics

Method: GET
URL: {domain}/external/category-characteristic/{id}/

Description:
Returns data for one characteristic block by its unique identifier.

Query example:

GET {domain}/external/category-characteristic/75/

Example answer:

{
    "id": 75,
    "category_id": 27,
    "name_ro": "Generalewer",
    "name_ru": "Generale",
    "name_en": null,
    "name_uk": null,
    "hide": true,
    "specifications": [
        {
            "id": 8
        },
        {
            "id": 9
        },
        {
            "id": 13
        }
    ]
}

3. Updating one block of characteristics

Method: PUT
URL: {domain}/external/category-characteristic/{id}/

Description:
Updates the data of one characteristic block by its unique identifier.

Query example:

PUT {domain}/external/category-characteristic/75/
Content-Type: application/json

Request body:

{
    "category_id": 27,
    "name_ro": "Bloc actualizat",
    "name_ru": "Updated block",
    "hide": false,
    "specifications": [
        {
            "id": 10
        },
        {
            "id": 12
        }
    ]
}

Example answer:

{
    "id": 75,
    "category_id": 27,
    "name_ro": "Bloc actualizat",
    "name_ru": "Updated block",
    "name_en": null,
    "name_uk": null,
    "hide": false,
    "specifications": [
        {
            "id": 10
        },
        {
            "id": 12
        }
    ]
}

4. Creating multiple characteristic blocks

Method: POST
URL: {domain}/external/category-characteristic/bulk-create/

Description:
Creates several stat blocks at the same time.

Query example:

POST {domain}/external/category-characteristic/bulk-create/
Content-Type: application/json

Request body:

[
    {
        "category_id": 28,
        "name_ro": "Bloc nou",
        "name_ru": "New block",
        "hide": true,
        "specifications": [
            {
                "id": 15
            },
            {
                "id": 16
            }
        ]
    },
    {
        "category_id": 29,
        "name_ro": "Bloc nou 2",
        "name_ru": "New block 2",

"hide": false, "specifications": [ { "id": 17 }, { "id": 18 } ] } ]

Example answer:

[
    {
        "id": 76,
        "category_id": 28,
        "name_ro": "Bloc nou",
        "name_ru": "New block",
        "hide": true,
        "specifications": [
            {
                "id": 15
            },
            {
                "id": 16
            }
        ]
    },
    {
        "id": 77,
        "category_id": 29,
        "name_ro": "Bloc nou 2",
        "name_ru": "New block 2",
        "hide": false,
        "specifications": [
            {
                "id": 17
            },
            {
                "id": 18
            }
        ]
    }
]

5. Updating multiple stat blocks

Method: PUT
URL: {domain}/external/category-characteristic/bulk-update/

Description:
Updates data from multiple characteristic blocks simultaneously.

Query example:

PUT {domain}/external/category-characteristic/bulk-update/
Content-Type: application/json

Request body:

[
    {
        "id": 75,
        "category_id": 27,
        "name_ro": "Bloc actualizat",
        "name_ru": "Updated block",
        "hide": false,
        "specifications": [
            {
                "id": 10
            },
            {
                "id": 12
            }
        ]
    },
    {
        "id": 76,
        "category_id": 28,
        "name_ro": "Bloc modificat",
        "name_ru": "Changed block",
        "hide": true,
        "specifications": [
            {
                "id": 19
            },
            {
                "id": 20
            }
        ]
    }
]

Example answer:

[
    {
        "id": 75,
        "category_id": 27,
        "name_ro": "Bloc actualizat",
        "name_ru": "Updated block",
        "hide": false,
        "specifications": [
            {
                "id": 10
            },
            {
                "id": 12
            }
        ]
    },
    {
        "id": 76,
        "category_id": 28,
        "name_ro": "Bloc modificat",
        "name_ru": "Changed block",
        "hide": true,
        "specifications": [
            {
                "id": 19
            },
            {
                "id": 20
            }
        ]
    }
]

Was the article helpful?

Yes, thank you! Unfortunately no

article.helpfulQuestion