Skip to main content
Skip table of contents

Link from media server

Link from media server

GET api/admin/v1/camera/{camera}/stream/{stream}/media-server-url

Method parameters

int camera, unique identifier for the camera


int stream, unique identifier for the stream


int type, format for which the link is needed. Possible values are hls and rtsp


date archive_start_at, if an archival link is needed, the date from which the archive is required in the format Y-m-dTH:i:sp should be sent


int token_life_time, number of hours the token for the link will be valid. If this parameter is not provided, the link will be without a token

200 OK

Successful response

JSON
{
    "url": "rtsp://host-name-3.vms.local:5554/live/71bd7d17-a0a7-4419-95db-911416c592a6/"
}

401 Unauthorized

Authorization token is not provided or is invalid. Obtaining a token

422 Unprocessable Entity

Returns a JSON object with an error. Validation

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The reason for the error will be described here"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domainapi/admin/v1/camera/{camera}/stream/{stream}/media-server-url' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "camera": 0,
    "stream": 0,
    "type": 0,
    "archive_start_at": "date",
    "token_life_time": 0
}'
PHP
PHP
$data = array (
  'camera' => 0,
  'stream' => 0,
  'type' => 0,
  'archive_start_at' => 'date',
  'token_life_time' => 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-domainapi/admin/v1/camera/{camera}/stream/{stream}/media-server-url', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.