Breadcrumbs

Reserve a device

The method and parameters

POST  /api/v1/billing/devices/reserve

Reserve a device so that it becomes unavailable for adding.

If a device is reserved, it cannot be added without additionally sending the skip_reserve_check parameter to the activation request.

JSON
{
    "type": "mediaagent",
    "mac": "fake_mac_5",
    "serial_number": "sn"
}

Possible error codes:

  • 33600 - Device not found

  • 33603 - Device already activated

  • 33610 - Device in the process of deactivation

  • 33622 - Device in initialization (just registered in the system and will be available soon)

  • 33599 - Device reserved

string type  required – a device type


string mac – a device Mac address


string serial_number – a device serial number

200  OK

Successful response

JSON
{
    "id": 25,
    "type": "mediaagent",
    "uuid": "7a593d26-8cfd-47e9-8647-1fb18a36fedb",
    "serial_number": "sn",
    "status": "reserve",
    "mac": "mac",
    "name": null,
    "version": "1.1.1.1",
    "created_at": null,
    "last_updated_at": null,
    "is_online": true
}

400  Bad Request

Reservation Error

JSON
{
    "message": "The reason for the error will be described here",
    "code": 1000
}

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/reserve' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "type": "string",
    "mac": "string",
    "serial_number": "string"
}'
PHP
PHP
$data = array (
  'type' => '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/billing/devices/reserve', false, $context);