26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Add BLE key to controller

Add a BLE key to a controller

POST  /api/v1/billing/ble-controllers/{ble_controller}/keys

If a key with the specified value doesn't exist, it is created automatically. The key is linked to the controller without duplication if already linked.

JSON
{
    "key": "123456789012"
}

Method parameters

string ble_controller  required , (path) BLE controller UUID.


string key  required , BLE key value. Digits only. Maximum 30 characters.

200  OK

BLE key added successfully (or already linked)

JSON
{
    "uuid": "00000000-0000-0000-0000-000000000010",
    "key": "123456789012",
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
}

404  Not Found

BLE controller not found

422  Unprocessable Entity

Validation error. For more information, see General information > Validation.

JSON
{
    "message": "Validation error",
    "errors": {
        "key": [
            "The key field must only contain digits."
        ]
    }
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/ble-controllers/{ble_controller}/keys' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "ble_controller": "string",
    "key": "string"
}'
PHP
PHP
$data = array (
  'ble_controller' => 'string',
  'key' => '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/ble-controllers/{ble_controller}/keys', false, $context);