26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Get URLs for camera Live and Archive video

POST  /api/v1/billing/cameras/video

For an archive link, the move_to field is added if the archive was requested before its start. To avoid an error when archive playback begins, the link date is moved to the date in move_to.

The expired_at field indicates when the link token expires.

This request can include a user's integration token. If the user has access to the camera, a link is generated.

For a deleted camera, no live link is provided: the response field url is null Only the archive is available. Archive links and archive_ranges are returned as usual.

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

Method parameters

array cameras  required , An array of camera IDs for which links are requested. Each camera object has the following properties:

  • uuid– UUID of the camera for which to generate a link. This field is required.

  • stream_type– video stream type. If omitted or set tocamerathe link is generated for the camera; if a stream type is provided, the link is generated for that specific camera stream.

  • archive_ranges– flag for including information about available archive ranges

  • date– archive start date used to generate an archive link


string source  required , Protocol type.

  • hls– HTTP Live Streaming (default)

  • rtsp - Real Time Streaming Protocol

  • webrtc - WebRTC-HTTP Ingestion Protocol


int ttl, Link lifetime in seconds

200  OK

Successful response with all parameters

JSON
[
    {
        "url": "http://127.0.0.1/test",
        "url_type": "camera",
        "expired_at": "2000-01-01T00:00:00.000000Z",
        "archive_ranges": [
            {
                "from": "2000-01-01T00:00:00.000000Z",
                "to": "2000-01-01T02:00:00.000000Z"
            }
        ],
        "move_to": "2000-01-01T00:00:00.000000Z"
    }
]

401  Unauthorized

If an authorization token is provided and is invalid

cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/cameras/video' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "cameras": [],
    "source": "string",
    "ttl": 0
}'
PHP
PHP
$data = array (
  'cameras' => 
  array (
  ),
  'source' => 'string',
  '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/billing/cameras/video', false, $context);