Skip to main content
Skip table of contents

Add a Bridge device

Add a bridge

Permission - bridges

JSON
{
    "name": "bridge_1",
    "mac": "08:13:c0:00:00:82",
    "serial_number": "serial_number"
}

POST /api/admin/v1/bridges/users/{user}

Parameters

int user, Unique user identifier


string name, Device name


string mac, MAC address of the device.


string serial_number, Device serial number.

200 OK

Returns the bridge object

JSON
{
    "id": 1,
    "serial_number": "12345678",
    "mac": "00-B0-D0-63-C2-26",
    "name": "bridge_1",
    "version": "1.0.1",
    "created_at": "2023-09-18T17:34:29.000000Z",
    "last_updated_at": "2023-09-18T17:34:54.000000Z",
    "is_online": true,
    "user": {
        "id": 1,
        "name": "admin",
        "login": "admin@mail.com",
        "created_at": "2023-07-17T13:21:16.000000Z",
        "cameras_count": null
    },
    "storages": [
        {
            "id": 2,
            "path": "/storage",
            "usage": 54.835,
            "capacity": 1024
        }
    ]
}

401 Unauthorized

Authorization token not sent or not valid

403 Forbidden

If the administrator or user (for whom the bridge is activated) does not have the necessary access rights

422 Unprocessable Entity

Returns a JSON object with an error.

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The cause of the error will be described here"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/bridges/users/{user}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "user": 0,
    "name": "string",
    "mac": "string",
    "serial_number": "string"
}'
PHP
PHP
$data = array (
  'user' => 0,
  'name' => 'string',
  'mac' => 'string',
  'serial_number' => 'string',
);
$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/admin/v1/bridges/users/{user}', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.