Attribute
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /attribute/create
This method allows adding attribute into the account.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
is_active | boolean | Ha | Standart: true |
items | string[] | Ha |
{
"name": "string",
"is_active": true,
"items": [
"string"
]
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_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.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
_id | string | Yo‘q | |
name | string | Yo‘q | |
is_active | boolean | Yo‘q | Standart: true |
items | string[] | Yo‘q |
{
"_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"name": "string",
"is_active": true,
"items": [
"string"
]
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /attribute/create.
GET /attribute/get-all
Get all attributes
So‘rov parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
is_active | boolean | Yo‘q | |
search | string | Yo‘q |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"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
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /attribute/create.
POST /attribute/get-paging
Get attributes by paging
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
search | string | Yo‘q | |
is_active | boolean | Yo‘q |
{
"page": 1,
"limit": 20,
"search": "string",
"is_active": false
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
_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"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.