Breadcrumbs

URLs for camera Archive

The method and parameters

POST  /api/v1/cameras/archive

The expired_at field indicates the expiration time of the link token.

As part of this request, you can include the user's integration token. If the camera is accessible to the user, a URL to the archived footage will be generated.

JSON
{
    "cameras": [
        {
            "uuid": "uuid",
            "stream_type": "high",
            "date": "2000-01-01T00:00:00Z"
        }
    ],
    "source": "hls"
}

array cameras  required – an array of UUIDs of cameras for which you are retrieving links. Each camera object has the following properties:

  • uuid – the UUID of the camera for which the archive link is to be generated. This field is required.

  • stream_type – a type of the video stream. If omitted or set to camera, the link will be generated for this camera. If the stream type is specified, the link will be generated for that particular stream type.

  • from – the start date and time of the archive segment

  • to – the end date and time of the archive segment


int ttl – a link lifetime in seconds.

200  OK

A successful response with all parameters

JSON
[ { "url": "http://127.0.0.1/test", "expired_at": "2000-01-01T00:00:00.000000Z" } ]

401  Unauthorized

When an authorization token is passed but is invalid

cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/cameras/archive' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "cameras": [],
    "ttl": 0
}'
PHP
PHP
$data = array (
  'cameras' => 
  array (
  ),
  'ttl' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/cameras/archive', false, $context);