Skip to main content
Skip table of contents

Список планoв

Список планов

GET /api/v1/maps

Параметры метода

int per_page, Кол-во элементов в одной странице пагинации. По умолчанию 25 элементов


int page, Номер страницы пагинации


string search, Фильтр


int camera, идентификатор камеры,данное поле для фильтрации планов, в которых есть данная камера


string cluster_key, Фильтрация планов, по нахождению в кластере на карте


boolean has_location, Фильтрация планов, задана им локация или нет.

response 200 Успешный ответ

JSON
{
    "data": [
        {
            "id": 14,
            "name": "тест",
            "created_at": "2022-04-22 14:51:54",
            "updated_at": "2022-04-22 14:51:54",
            "url": "https://vms.local/storage/path.jpg",
            "group_id": 1,
            "cameras": [
                {
                    "x": 29,
                    "y": 82,
                    "angle": 61,
                    "radius": 50.5463836852,
                    "segment_angle": 80.3322,
                    "camera": {
                        "id": 92650,
                        "group_id": 52039,
                        "status": "active",
                        "type": "mediaserver_v2",
                        "start_at": "2022-03-23 14:51:54",
                        "created_at": "2020-11-27 16:40:23",
                        "billing_id": null,
                        "pretty_name": "камера 2",
                        "pretty_text": "Область обл., Районный р-н, г. Город, ул. Улица 1",
                        "short_address": "г. Город, ул. Улица 1",
                        "full_address": "Область обл., Районный р-н, г. Город, ул. Улица 1",
                        "lat": null,
                        "lng": null,
                        "azimuth": null,
                        "streams": [
                            {
                                "id": 204868,
                                "type": "high",
                                "camera_id": 92650,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            },
                            {
                                "id": 204871,
                                "type": "low",
                                "camera_id": 92650,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            }
                        ],
                        "services": {
                            "ptz": false,
                            "motion_detect": false
                        },
                        "has_sound": false,
                        "archive_recording_timetable": {
                            "days": [
                                {
                                    "to": "13:39:25",
                                    "from": "13:38:25",
                                    "type": "monday"
                                }
                            ]
                        },
                        "archive_ranges": [
                            {
                                "end": 1650627922,
                                "from": 1649312173,
                                "duration": 1315749
                            }
                        ],
                        "is_archive_recording": true,
                        "is_bridge": false,
                        "is_favorite": false,
                        "is_owner": true,
                        "can_change_archive_timetable": true,
                        "archive_recording_type": "timetable",
                        "user_status": "active",
                        "name": "камера 2"
                    }
                }
            ]
        }
    ],
    "links": {
        "first": "https://vms.local/api/v3/maps?page=1",
        "last": "https://vms.local/api/v3/maps?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            },
            {
                "url": "https://vms.local/api/v3/maps?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "pagination.next",
                "active": false
            }
        ],
        "path": "https://vms.local/api/v3/maps",
        "per_page": 25,
        "to": 1,
        "total": 1
    }
}

401 Unauthorized

Токен авторизации не передан или не валидный

422 Unprocessable Entity

Возвращает JSON объект с ошибкой. VMS Client/Общая информация/Валидация клиента

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/maps' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "per_page": 0,
    "page": 0,
    "search": "string",
    "camera": 0,
    "cluster_key": "string",
    "has_location": "boolean"
}'
PHP
PHP
$data = array (
  'per_page' => 0,
  'page' => 0,
  'search' => 'string',
  'camera' => 0,
  'cluster_key' => 'string',
  'has_location' => 'boolean',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/maps', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.