๐Ÿช‘Zones

This page provides a description of the available API routes for managing zones.

The zone represents visual representation of a specific area, such as a room, terrace, or any other defined space. It contains the layout, dimensions, and arrangement of objects within that area.

The data model for zone is represented by Zone class.

API methods

Get zones

GET http://{server-address}/zones

Returns all zones that matches query parameters. Result is of type QueryResult<Zone>.

Query Parameters

Headers

{
    "items":
    [
        {
            "name": "Bar",
            "defaultFiscalName": null,
            "items":
            [
                {
                    "name": "B01",
                    "isTable": true,
                    "meta":
                    {
                        "position":
                        {
                            "x": 0.10,
                            "y": 0.10
                        },
                        "width": 0.12,
                        "height": 0.12,
                        "shape": "Rectangle",
                        "rotation": 0,
                        "color": "#cccccc"
                    }
                },
                {
                    "name": "B02",
                    "isTable": true,
                    "meta":
                    {
                        "position":
                        {
                            "x": 0.30,
                            "y": 0.10
                        },
                        "width": 0.12,
                        "height": 0.12,
                        "shape": "Rectangle",
                        "rotation": 0,
                        "color": "#cccccc"
                    }
                }
            ],
            "sortHint": 1,
            "_v": 1
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get zone by name

GET http://{server-address}/zones/{name}

Result is of type Zone.

Path Parameters

Headers

{
    "name": "Bar",
    "defaultFiscalName": null,
    "items":
    [
        {
            "name": "B01",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.10,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        },
        {
            "name": "B02",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.30,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        }
    ],
    "sortHint": 1,
    "_v": 1
}

Create zone

POST http://{server-address}/zones

Creates new zone. Result is of type Zone.

Required rights

Authorized user must have ZoneCreate right assigned.

Headers

Request Body

{
    "name": "Bar",
    "defaultFiscalName": null,
    "items":
    [
        {
            "name": "B01",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.10,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        },
        {
            "name": "B02",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.30,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        }
    ],
    "sortHint": 1,
    "_v": 1
}

Create or update zone

PUT http://{server-address}/zones/{name}

Updates existing or creates new zone. Result is of type Zone.

Required rights

Authorized user must have assigned ZoneCreate or ZoneUpdate right.

Path Parameters

Headers

Request Body

{
    "name": "Bar",
    "defaultFiscalName": null,
    "items":
    [
        {
            "name": "B01",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.10,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        },
        {
            "name": "B02",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.30,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        }
    ],
    "sortHint": 1,
    "_v": 1
}

Delete zone by name

DELETE http://{server-address}/zones/{name}

Required rights

Authorized user must have ZoneDelete right assigned.

Path Parameters

Headers

{
    "name": "Bar",
    "defaultFiscalName": null,
    "items":
    [
        {
            "name": "B01",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.10,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        },
        {
            "name": "B02",
            "isTable": true,
            "meta":
            {
                "position":
                {
                    "x": 0.30,
                    "y": 0.10
                },
                "width": 0.12,
                "height": 0.12,
                "shape": "Rectangle",
                "rotation": 0,
                "color": "#cccccc"
            }
        }
    ],
    "sortHint": 1,
    "_v": 1
}

Last updated