Skip to main content
Skip table of contents

List of layouts. VMS Client API

The responses vary depending on the clients. For decktop clients, the responses are not paginated and the first 100 layouts are taken. For all other clients, the list is paginated.

GET/api/v1/layouts

Headers

Authorization

Bearer token

Accept

application/json

X-Client

ios-cctv|android-cctv|thick-legal|web

X-UUID

unique device id

Body

per_pagerequired

int

Number of items per pagination page. Default is 25

pagerequired

int

Pagination page number

searchrequired

string

Search by layout name

idsrequired

array

Array of layout IDs to be included in the response

exclude_for_userrequired

int

ID of the sub-user whose shared layouts should be excluded from the response

Response

200

Successful response

JSON
{
    "data": [
        {
            "id": 219,
            "name": "1",
            "layout_template_id": 1,
            "layout_template": "Grid11",
            "user_id": 5,
            "grid": [
                {
                    "id": 751,
                    "group_id": 101,
                    "status": "active",
                    "type": "media_server_v2",
                    "start_at": "2022-03-03 17:50:52",
                    "created_at": "2022-01-27 19:46:27",
                    "billing_id": null,
                    "pretty_name": "Camera 1",
                    "pretty_text": "Cameras",
                    "short_address": "Cameras",
                    "full_address": "Cameras",
                    "lat": null,
                    "lng": null,
                    "azimuth": null,
                    "streams": [
                        {
                            "id": 744,
                            "type": "high",
                            "camera_id": 751,
                            "is_preview_from_server": true,
                            "is_archive_from_server": null,
                            "status": "active",
                            "has_sound": false,
                            "layout_priority": "reserve",
                            "width": 2048,
                            "height": 1536
                        },
                        {
                            "id": 745,
                            "type": "low",
                            "camera_id": 751,
                            "is_preview_from_server": true,
                            "is_archive_from_server": null,
                            "status": "active",
                            "has_sound": false,
                            "layout_priority": "main",
                            "width": 2048,
                            "height": 1536
                        }
                    ],
                    "services": {
                        "ptz": false,
                        "motion_detect": false
                    },
                    "has_sound": false,
                    "is_archive_recording": true,
                    "is_bridge": false,
                    "is_favorite": false,
                    "user_status": "active",
                    "name": "Камера 1"
                }
            ],
            "created_at": "2021-10-04 13:57:56",
            "updated_at": "2021-10-04 13:57:56"
        }
    ],
    "links": {
        "first": "https://vms.local/api/v1/layouts?page=1",
        "last": "https://vms.local/api/v1/layouts?page=3",
        "prev": null,
        "next": "https://vms.local/api/v1/layouts?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 3,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            },
            {
                "url": "https://vms.local/api/v1/layouts?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://vms.local/api/v1/layouts?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://vms.local/api/v1/layouts?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://vms.local/api/v1/layouts?page=2",
                "label": "pagination.next",
                "active": false
            }
        ],
        "path": "https://vms.local/api/v1/layouts",
        "per_page": 15,
        "to": 15,
        "total": 40
    }
}
401

Authorization token not provided or invalid, see Obtaining a token

422

Returns a JSON object with an error, see Validation

JSON
{
    "message": "There won't be any informative message here",
    "errors": {
        "any_key": [
            "Here the error cause will be described"
        ]
    }
}

Example

JSON
curl -k --location --request GET 'https://vms.local/api/v1/layouts?per_page=int&page=int&search=string&ids=array&exclude_for_user=int' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id'
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.