Breadcrumbs

Activate a device

The method and parameters

POST  /api/v1/billing/devices/activate

You can pass either mac or serial_number.

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

string login  required – the login of the user to whom you want to add a device.


string name  required – the name of the device.


string type  required – a device type.


string mac – the MAC address of the device.


string serial_number – the device serial number.


bool skip_reserve_check – this parameter is required to activate a device that is reserved

201  Created

Successful response

JSON
{
    "id": 25,
    "serial_number": "sn",
    "mac": "mac",
    "name": "test",
    "version": "1.1.1.1",
    "created_at": "2000-00-00T00:00:00.000000Z",
    "last_updated_at": null,
    "is_online": true
}

422  Unprocessable Entity

Returns a JSON object with an error. For details, see General information > Validation.

JSON
{
    "message": "No error message here",
    "errors": {
        "any_key": [
            "Error details"
        ]
    }
}
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);