Skip to main content
Skip table of contents

Активация устройства через биллинг

Передавать можно либо mac либо serial_number

JSON
{
    "login": "user-login",
    "name": "name",
    "type": "mediaagent",
    "mac": "fake_mac_5",
    "serial_number": "sn",
    "skip_reserve_check": false
}

POST /api/v1/billing/devices/activate

Параметры метода

string login REQUIRED, Логин пользователя, которому надо добавить устрйоство


string name REQUIRED, Name for the device


string type REQUIRED, Тип устройства


string mac, Мак адрес устрйоства


string serial_number, Серийный номер устройства


bool skip_reserve_check, Данный параметр необходим, чтоб активировать устройство, которое зарезервировано

201 Created

Успешный ответ

JSON
{
    "id": 25,
    "serial_number": "sn",
    "type": "mediabridge",
    "mac": "mac",
    "name": "test",
    "version": "1.1.1.1",
    "created_at": "2000-00-00T00:00:00.000000Z",
    "last_updated_at": null,
    "is_online": true,
    "user": {
        "id": 6,
        "login": "user@mail.com",
        "name": "user",
        "type": "special",
        "status": "active",
        "created_at": "2000-00-00T00:00:00.000000Z",
        "updated_at": "2000-00-00T00:00:00.000000Z",
        "deleted_at": null,
        "can_update_password": true,
        "billing_properties": []
    },
    "storages": [
        {
            "id": 39,
            "path": "/storage1",
            "usage": 73.723,
            "capacity": 137
        }
    ],
    "cameras_count": 0
}

422 Unprocessable Entity

Возвращает JSON объект с ошибкой. VMS Billing/Общая информация/Валидация внешней системы

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/devices/activate' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "login": "string",
    "name": "string",
    "type": "string",
    "mac": "string",
    "serial_number": "string",
    "skip_reserve_check": true
}'
PHP
PHP
$data = array (
  'login' => 'string',
  'name' => 'string',
  'type' => 'string',
  'mac' => 'string',
  'serial_number' => 'string',
  'skip_reserve_check' => true,
);
$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/devices/activate', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.