Интеграция "IDEA Service (NEW)"

Postman collection → OpenAPI spec →

Introduction

Authenticating requests

This API is not authenticated.

Dostavka

Qo'shish

POST
http://xideaservice.loc
/api/delivery_application/add
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/delivery_application/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Qadamga o'tkazish

PUT
http://xideaservice.loc
/api/delivery_application/change_step
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/delivery_application/change_step"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "app_id": 1,
    "change_step": "in_progress",
    "comment": "...comment",
    "params": []
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ortga qaytarish

PUT
http://xideaservice.loc
/api/delivery_application/rollback
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/delivery_application/rollback"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "app_id": 1,
    "comment": "...comment"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

ID orqali olish

GET
http://xideaservice.loc
/api/delivery_application/get/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

Delivery ID.

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/delivery_application/get/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ro'yxat

GET
http://xideaservice.loc
/api/delivery_application/list
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/delivery_application/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 1,
    "per_page": 10,
    "order_by": "id",
    "order_direction": "asc",
    "step": [
        "new"
    ],
    "status_time": [
        1
    ],
    "order_date_start": "2020-01-01",
    "order_date_end": "2020-02-15",
    "drivers": [
        1
    ],
    "branch": [
        1
    ],
    "branch_sale": [
        2
    ],
    "online": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Fcm

Token qo'shish

POST
http://xideaservice.loc
/api/fcm/add
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/fcm/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fcm_token": "abcdef123456",
    "auth_token": "abcdef001122"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Tokenni o'chirish

DELETE
http://xideaservice.loc
/api/fcm/delete
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/fcm/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "auth_token": "abcdef001122"
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Filial

Filial ma'lumotini yangilash

PUT
http://xideaservice.loc
/api/branch/update
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/branch/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1,
    "name": "Yakkasaroy",
    "address": "Yakkasaroy Qushbegi",
    "region_id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Filialni olish

GET
http://xideaservice.loc
/api/branch/get/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/branch/get/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Filiallar ro'yxatini olish

GET
http://xideaservice.loc
/api/branch/list
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/branch/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 1,
    "per_page": 10,
    "order_by": "id",
    "order_direction": "asc",
    "status": 1,
    "name": "Yakk...",
    "region_id": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Mashina (Car)

Qo'shish

POST
http://xideaservice.loc
/api/car/add
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/car/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "number": "01A777AA",
    "model": "Dodge Challenger"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Yangilash

PUT
http://xideaservice.loc
/api/car/update
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/car/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1,
    "number": "01A777AA",
    "model": "Dodge Challenger"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Statusini belgilash

PUT
http://xideaservice.loc
/api/car/set_status
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/car/set_status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1,
    "status": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Mashinani olish

GET
http://xideaservice.loc
/api/car/get/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

Mashina ID.

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/car/get/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Mashinalar ro'yxati

GET
http://xideaservice.loc
/api/car/list
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/car/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 1,
    "per_page": 10,
    "order_by": "id",
    "order_direction": "asc",
    "status": 1,
    "number": "..77..",
    "model": "..BMW..",
    "query": "..q.."
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Mashina foydalanuvchilarini saqlash

POST
http://xideaservice.loc
/api/car/save_users
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/car/save_users"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "car_id": 1,
    "users": [
        1
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Qadamlar

Qadamlar ro'yxatini olish

GET
http://xideaservice.loc
/api/step_option/{type?}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

type
string

nullable Qadam turi.

Example:
delivery
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/step_option/delivery"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

"Options" ni yangilash

PUT
http://xideaservice.loc
/api/step_option/update
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/step_option/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1,
    "options": []
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Rol

Qo'shish

POST
http://xideaservice.loc
/api/role/add
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "clone_with": 2,
    "users": [
        13
    ],
    "key": "admin",
    "title": "Администратор",
    "color": "#ff1122"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Yangilash

PUT
http://xideaservice.loc
/api/role/update
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 2,
    "users": [
        5
    ],
    "key": "admin",
    "title": "Администратор",
    "color": "#ff1122"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Olish

GET
http://xideaservice.loc
/api/role/get/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role/get/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ro'yxatini olish

GET
http://xideaservice.loc
/api/role/list/{deleted?}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

deleted
integer

nullable 0-aktivlarni, 1-o'chirilganini olish

Example:
0
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role/list/0"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

O'chirish

DELETE
http://xideaservice.loc
/api/role/delete/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role/delete/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Tiklash

PUT
http://xideaservice.loc
/api/role/recovery/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role/recovery/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Rol ruxsatnomalari

Rol orqali olish

GET
http://xideaservice.loc
/api/role_perms/get_by_role/{id}/{withChildren?}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

Rol ID

Example:
1
withChildren
integer

nullable children bilan olish

Example:
0
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role_perms/get_by_role/1/0"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ruxsatnoma orqali olish

GET
http://xideaservice.loc
/api/role_perms/get_by_permission/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

Ruxsatnoma ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role_perms/get_by_permission/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Saqlash

PUT
http://xideaservice.loc
/api/role_perms/save
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role_perms/save"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "update_with": "role",
    "id": 1,
    "allows": [
        {
            "role_id": "1",
            "permission_id": "1",
            "value": "1"
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Foydalanuvchi ruxsatnomalarini olish

GET
http://xideaservice.loc
/api/role_perms/user_roles/{id?}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer

nullable Foydalanuvchi ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/role_perms/user_roles/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ruxsatlar

Qo'shish

POST
http://xideaservice.loc
/api/permission/add
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/permission/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "key": "my Group 2",
    "parent_id": 1,
    "is_parent": 1,
    "title": "Мой право",
    "type": "list",
    "options": [
        0,
        "own",
        "all"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Yangilash

PUT
http://xideaservice.loc
/api/permission/update
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/permission/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1,
    "key": "my Group 2",
    "parent_id": 1,
    "is_parent": 1,
    "title": "Мой право",
    "type": "list",
    "options": [
        0,
        "own",
        "all"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

GET api/permission/get/{id}

GET
http://xideaservice.loc
/api/permission/get/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
string
required

The ID of the get.

Example:
5
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/permission/get/5"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ro'yxatini olish

GET
http://xideaservice.loc
/api/permission/list/{type?}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

type
string

nullable Ro'yxat turi: 0(yuborilmasa) - hammasi, 1 - children bilan, 2 - faqat parentlar

Example:
0
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/permission/list/0"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

O'chirish (butunlay)

DELETE
http://xideaservice.loc
/api/permission/delete/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

ID

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/permission/delete/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Vaqt sozlamasi

Yaratish

POST
http://xideaservice.loc
/api/time_config/create
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/time_config/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "time": 96
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Asosiy qilib belgilash

PUT
http://xideaservice.loc
/api/time_config/set_active
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/time_config/set_active"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Ro'yxat

GET
http://xideaservice.loc
/api/time_config/list
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/time_config/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Viloyatlar

Ro'yxatini olish

GET
http://xideaservice.loc
/api/region/list
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/region/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Авторизация | Tizimga kirish

Логин | kirish

POST
http://xideaservice.loc
/api/auth/login

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": "998001002030",
    "password": "123456"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:

Обновить токен | Tokenni yangilash

PUT
http://xideaservice.loc
/api/auth/refresh_token

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/auth/refresh_token"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "refresh_token": "def5020001c87e946a497c063ae8d75ceb8173b749d10442db3feb4ccd42082f1c9de821f7859d7a50f7c0..."
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 58
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Client error: `POST http://xideaservice.loc/oauth/token` resulted in a `401 Unauthorized` response:\n{\"error\":\"invalid_request\",\"error_description\":\"The refresh token is invalid.\",\"hint\":\"Cannot decrypt the refresh token\" (truncated...)\n [BadResponseException]"
        }
    ]
}

Выйти | Chiqish

GET
http://xideaservice.loc
/api/auth/logout
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/auth/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Пользователи | Foydalanuvchilar

Получить основную информацию о пользователе | Foydalanuvchining asosiy am'lumotlarini olish

GET
http://xideaservice.loc
/api/auth/user
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/auth/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Qo'shish

POST
http://xideaservice.loc
/api/user/add
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/user/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Jhon",
    "phone": 998001002030,
    "password": "123456",
    "role_key": "guest",
    "branch_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Yangilash

PUT
http://xideaservice.loc
/api/user/update
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/user/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 1,
    "name": "Jhon",
    "phone": 998001002030,
    "password": "123456",
    "role_key": "admin",
    "branch_id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Получить пользователя по ID | Foydalanuvchini ID bo'yicha olish

GET
http://xideaservice.loc
/api/user/get/{id}
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

id
integer
required

ID.

Example:
1
Request sample:
const url = new URL(
    "http://xideaservice.loc/api/user/get/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Получить список пользователей | Foydalanuvchilar ro'yxatini olish

GET
http://xideaservice.loc
/api/user/list
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/user/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 1,
    "per_page": 10,
    "order_by": "id",
    "order_direction": "asc",
    "status": 1,
    "query": "Jho...",
    "name": "Jho...",
    "phone": "...123...",
    "role_key": "guest",
    "is_admin": 1,
    "branch_id": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Foydalanuvchi mashinalarini saqlash

POST
http://xideaservice.loc
/api/user/save_cars
requires authentication

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/user/save_cars"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user_id": 1,
    "cars": [
        1
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "Войдите, чтобы использовать систему!"
        }
    ]
}

Раздел загрузки | Yuklash bo'limi

Загрузить изображение | Rasm yuklash

POST
http://xideaservice.loc
/api/upload/image

Headers

Content-Type
Example:
multipart/form-data
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/upload/image"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 57
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "hash_name": "Tnp9nyPc7VOHykyxwZfU5tkhzCLoURldx7DrjgLc.jpg",
    "name": "test.jpg",
    "mime_type": "image/jpeg",
    "type": 1,
    "size": 5120,
    "path": "/var/www/idea-service-back/storage/app/public/temp/Tnp9nyPc7VOHykyxwZfU5tkhzCLoURldx7DrjgLc.jpg",
    "url": "/storage/temp/Tnp9nyPc7VOHykyxwZfU5tkhzCLoURldx7DrjgLc.jpg",
    "status": 0,
    "updated_at": "2023-05-23 16:24:45",
    "created_at": "2023-05-23 16:24:45",
    "id": 2
}

Загрузить видео | Video yuklash

POST
http://xideaservice.loc
/api/upload/video

Headers

Content-Type
Example:
multipart/form-data
Accept
Example:
application/json

Body Parameters

Request sample:
const url = new URL(
    "http://xideaservice.loc/api/upload/video"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
Response sample:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 56
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "errors": [
        {
            "message": "file должен быть файлом типа: video/x-flv, video/mp4, application/x-mpegURL, video/MP2T, video/3gpp, video/quicktime, video/x-msvideo, video/x-ms-wmv. (file)",
            "key": "file"
        }
    ]
}