Attribute
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /attribute/create
This method allows adding attribute into the account.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | |
is_active | boolean | Да | По умолчанию: true |
items | string[] | Да |
{
"name": "string",
"is_active": true,
"items": [
"string"
]
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | |
name | string | |
is_active | boolean | |
items | object[] | |
items[]._id | string | |
items[].name | string | |
items[].attribute_id | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"is_active": false,
"items": [
{
"_id": "string",
"name": "string",
"attribute_id": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /attribute/update
This method allows updating attribute in the account.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
_id | string | Нет | |
name | string | Нет | |
is_active | boolean | Нет | По умолчанию: true |
items | string[] | Нет |
{
"_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"name": "string",
"is_active": true,
"items": [
"string"
]
}Ответ
Структура ответа совпадает с POST /attribute/create.
GET /attribute/get-all
Get all attributes
Параметры запроса
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
is_active | boolean | Нет | |
search | string | Нет |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"name": "string",
"is_active": false,
"items": [
{
"_id": null,
"name": null,
"attribute_id": null
}
]
}
],
"time": "2025-05-01T12:00:00Z"
}GET /attribute/get-by-id/{id}
Get attribute using its _id
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /attribute/create.
POST /attribute/get-paging
Get attributes by paging
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
search | string | Нет | |
is_active | boolean | Нет |
{
"page": 1,
"limit": 20,
"search": "string",
"is_active": false
}Ответ
data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.
| Поле | Тип | Описание |
|---|---|---|
_id | string | |
name | string | |
is_active | boolean | |
items | object[] | |
items[]._id | string | |
items[].name | string | |
items[].attribute_id | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"name": "string",
"is_active": false,
"items": [
{
"_id": "string",
"name": "string",
"attribute_id": "string"
}
]
}
]
},
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.