Skip to main content
Skip table of contents

Add a client bridge

Adding a bridge

Permission - bridges

Possible values ​​for the status field:

  • activated - device added and activated by user

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

POST /api/v1/bridges

Parameters

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,
    "name": "name",
    "uuid": "uuid",
    "mac": "mac",
    "serial_number": "serial_number",
    "status": "activated",
    "is_online": true,
    "version": "1.1.1.1",
    "last_updated_at": "2020-01-01T00:00:00.000000Z",
    "created_at": "2023-02-03T10:51:53.000000Z",
    "updated_at": "2023-02-03T10:51:53.000000Z",
    "storages": [
        {
            "id": 2,
            "path": "/storage",
            "usage": 15.5,
            "capacity": 100000.5
        }
    ]
}

401 Unauthorized

Authorization token not sent or not valid

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/v1/bridges' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "name": "string",
    "mac": "string",
    "serial_number": "string"
}'
PHP
PHP
$data = array (
  '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/v1/bridges', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.