Skip to main content
Skip table of contents

Просмотр скрипта. VMS Admin API

Просмотр скрипта

GET /api/admin/v1/scripts/{script}

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

int script, уникальный идентификатор скрипта

200 OK

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

JSON
{
    "id": 902,
    "event": {
        "id": 41,
        "name": "person_counting",
        "description": "Подсчет людей в области",
        "color": "#FF7CF2",
        "analytic_type": "person_counting"
    },
    "reaction": null,
    "users": [
        {
            "id": 3,
            "name": "user",
            "login": "user",
            "created_at": "2021-05-27 15:43:37",
            "updated_at": "2022-05-06 14:19:13",
            "expired_at": null,
            "is_licence_limit_reached": false,
            "ptz_priority": 10,
            "access_token_id": null
        },
        {
            "id": 4,
            "name": "user",
            "login": "user",
            "created_at": "2021-05-27 15:43:37",
            "updated_at": "2022-05-06 14:19:13",
            "expired_at": null,
            "is_licence_limit_reached": false,
            "ptz_priority": 10,
            "access_token_id": null
        },
        {
            "id": 19,
            "name": "user",
            "login": "user",
            "created_at": "2021-08-11 17:35:13",
            "updated_at": "2021-09-20 17:30:28",
            "expired_at": null,
            "is_licence_limit_reached": false,
            "ptz_priority": 10,
            "access_token_id": null
        }
    ],
    "schedule": [
        {
            "day": 0,
            "ranges": [
                {
                    "to": "23:59:59",
                    "from": "00:00:00"
                }
            ]
        }
    ],
    "created_at": "2022-02-18 18:01:54",
    "updated_at": "2022-02-18 18:02:52"
}

401 Unauthorized

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

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/scripts/{script}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "script": 0
}'
PHP
PHP
$data = array (
  'script' => 0,
);
$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/admin/v1/scripts/{script}', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.