Skip to main content
Skip table of contents

Камера клиента с ПО агент. Обновление камеры клиента

Обновление устройства

Permission - camera-agents

JSON
{
    "name": "camera_agent_name"
}

PATCH /api/v1/camera-agents/{cameraAgent}

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

int cameraAgent, Уникальный идентификатор устройства


string name, Имя устройства


bool is_local_archive_enabled, Включение/выключение локального архива


bool is_cloud_archive_enabled, Включение/выключение облачного архива


int cloud_archive_storage_days, Количество дней хранения облачного архива

200 OK

Возвращает объект устройства

JSON
{
    "id": 1,
    "name": "camera_agent_name",
    "uuid": "d2ba9774-eb19-4654-9bfd-037b58e93af4",
    "mac": "mac1",
    "serial_number": "serial1",
    "status": "activated",
    "is_online": false,
    "version": "3.4",
    "last_updated_at": null,
    "created_at": "2024-05-27T12:55:49.000000Z",
    "updated_at": "2024-05-27T12:55:49.000000Z",
    "storages": [
        {
            "id": 1,
            "path": "/storage",
            "usage": 33.333,
            "capacity": 0.03
        }
    ],
    "camera": {
        "id": 1,
        "group_id": 1,
        "status": "initial",
        "type": "mediaagent",
        "start_at": null,
        "created_at": "2024-05-27T12:55:49.000000Z",
        "billing_id": null,
        "pretty_name": "camera-name",
        "original_name": "camera-name",
        "lat": null,
        "lng": null,
        "azimuth": null,
        "streams": [
            {
                "id": 1,
                "type": "high",
                "camera_id": 1,
                "url": "rtsp://admin:pass@server.local:554/Streaming/Channels/101",
                "is_preview_from_server": true,
                "is_archive_from_server": null,
                "status": null,
                "has_sound": false,
                "width": null,
                "height": null,
                "video_codec": null,
                "audio_codec": null
            },
            {
                "id": 2,
                "type": "low",
                "camera_id": 1,
                "url": "rtsp://admin:pass@server.local:554/Streaming/Channels/102",
                "is_preview_from_server": true,
                "is_archive_from_server": null,
                "status": null,
                "has_sound": false,
                "width": null,
                "height": null,
                "video_codec": null,
                "audio_codec": null
            }
        ],
        "has_sound": false,
        "archive_recording_type": "fulltime",
        "can_change_archive_timetable": false,
        "is_bridge": false,
        "is_agent": true,
        "is_intercom": false,
        "is_cloud_archive_enabled": false,
        "is_local_archive_enabled": false,
        "cloud_archive_storage_days": 0,
        "local_archive_storage_days": 0,
        "ip": "127.0.0.1",
        "port": 554,
        "is_favorite": false,
        "is_restricted_live": null,
        "is_restricted_archive": null,
        "user_status": "active",
        "note": null,
        "name": "qwe-name"
    }
}

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/camera-agents/{cameraAgent}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "cameraAgent": 0,
    "name": "string",
    "is_local_archive_enabled": true,
    "is_cloud_archive_enabled": true,
    "cloud_archive_storage_days": 0
}'
PHP
PHP
$data = array (
  'cameraAgent' => 0,
  'name' => 'string',
  'is_local_archive_enabled' => true,
  'is_cloud_archive_enabled' => true,
  'cloud_archive_storage_days' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PATCH',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/camera-agents/{cameraAgent}', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.