Skip to main content
Skip table of contents

Remove deletion protection from a DVR segment: Stream.Dvr.Unlock

The method and parameters

With this method, you can remove the flag that protected a DVR segment from deletion.

string Stream.Dvr.Unlock( CamerasObject cameras )

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

StreamsObject cameras REQUIRED – sets up parameters for the camera stream.

object StreamsObject

number cameras.camerasUid.streamUid.from = 10 – specify the timestamp from which the Lock DVR flag (protection from deletion) should be removed. Should be in the Unix time format. 0 – means to remove the flag from the very beginning of DVR.


number cameras.camerasUid.streamUid.to = 10 – this parameter sets the end time for the Lock DVR flag (protection from deletion) should be removed. Should be in the Unix time format. 0 – means to remove the flag till the very end of DVR.


CamerasObject camerasUid REQUIRED – a unique camera identifier within the installation.


StreamsObject streamUid REQUIRED – a unique camera stream identifier within the camera. 


POST /api/

JSON-RPC
JSON
{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Unlock",
    "params": {
        "cameras": {
            "camerasUid": {
                "streamUid": {
                    "from": 10,
                    "to": 10
                }
            }
        }
    },
    "id": 1
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/' \
	--header 'Content-Length: 278' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--header 'Authorization: Bearer <api-authorization-token>' \
	--header 'Content-Length: <Content length>' \
	--data '{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Unlock",
    "params": {
        "cameras": {
            "camerasUid": {
                "streamUid": {
                    "from": 10,
                    "to": 10
                }
            }
        }
    },
    "id": 1
}'
PHP
PHP
$data = array (
  'jsonrpc' => '2.0',
  'method' => 'Stream.Dvr.Unlock',
  'params' => 
  array (
    'cameras' => 
    array (
      'camerasUid' => 
      array (
        'streamUid' => 
        array (
          'from' => 10,
          'to' => 10,
        ),
      ),
    ),
  ),
  'id' => 1,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json\r
Authorization: Bearer <api-authorization-token>\r
Content-Length: <Content length>",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/', false, $context);

400 Bad Request

The JSON-RPC error

JSON
{
    "error": {
        "code": -32601,
        "message": "Method not found"
    }
}

500 Internal Server Error

The server error

JavaScript errors detected

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

If this problem persists, please contact our support.