chg-proposal
GET
/categories/navigation
Получить данные об отдельной категории, её подкатегориях и главной категории, которой она принадлежит
Request parameters
slug
string
required
Responses
200
OK
Body
Object
id
number
slug
string
title
string
active
boolean
children
Array
Дочерние категории
Object
id
number
slug
string
title
string
active
boolean
hasChildren
boolean
Признак наличия потомков у дочерней категории
mainCategory
Object
Главная категория, в дереве которой находится искомая
id
number
slug
string
title
string
active
boolean
Example 1
Example 2
GET /categories/navigation?slug=buhgalterskiy-i-nalogovyy-uchet-audit-8990 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 8990,
"slug": "buhgalterskiy-i-nalogovyy-uchet-audit-8990",
"title": "Бухгалтерский и налоговый учет. Аудит",
"active": true,
"children": [
{
"id": 8991,
"slug": "buhgalterskiy-uchet-8991",
"title": "Бухгалтерский учет",
"active": true,
"hasChildren": false
},
{
"id": 8995,
"slug": "audit-8995",
"title": "Аудит",
"active": true,
"hasChildren": false
},
],
"mainCategory": {
"id": 18030,
"slug": "knigi",
"title": "Книги",
"active": true
}
}
Главная категория
GET /categories/navigation?slug=knigi HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 18030,
"slug": "knigi",
"title": "Книги",
"active": true,
"children": [
{
"id": 8979,
"slug": "delovaya-literatura-8979",
"title": "Деловая литература",
"active": true,
"hasChildren": true
},
{
"id": 9035,
"slug": "iskusstvo-9035",
"title": "Искусство",
"active": true,
"hasChildren": true
}
],
"mainCategory": null
}