26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Get a virtual key by ID

Get a virtual key by ID

GET  /api/v1/billing/ble-controllers/{ble_controller}/virtual-keys/{key}

Returns a BLE controller virtual key by its ID. A key belonging to another controller isn't found at this endpoint (404).

Key fields:

  • id – key ID;

  • ble_device_id – BLE controller UUID;

  • user – key owner: id, login, name;

  • type – key type: permanent (permanent) or temporary (temporary);

  • valid_from – start of validity; for a permanent key, null;

  • valid_till – expiration date;

  • is_active – key is enabled;

  • is_valid_now – key is currently valid: enabled and the current time falls within the valid_from - valid_till;

  • created_by – key issuer: id, login (for keys issued through the Billing API, billing);

  • created_at, updated_at – creation and update dates.

Method parameters

string ble_controller  required , BLE controller UUID (in URL)


int key  required , Virtual key ID (in URL)

200  OK

Successful response

JSON
{
    "id": 15,
    "ble_device_id": "00000000-0000-0000-0000-000000000001",
    "user": {
        "id": 42,
        "login": "170300101",
        "name": "Ivan Petrov"
    },
    "type": "permanent",
    "valid_from": null,
    "valid_till": "2126-01-15T10:00:00.000000Z",
    "is_active": true,
    "is_valid_now": true,
    "created_by": {
        "id": 2,
        "login": "billing"
    },
    "created_at": "2026-01-15T10:00:00.000000Z",
    "updated_at": "2026-01-15T10:00:00.000000Z"
}

404  Not Found

BLE controller not found

JSON
{
    "error": "resource not found"
}

404  Not Found

Key not found on this controller

JSON
{
    "error": "wrong api endpoint"
}
cURL
Bash
curl -k --request GET \
	--url 'https://your-domain/api/v1/billing/ble-controllers/{ble_controller}/virtual-keys/{key}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "ble_controller": "string",
    "key": 0
}'
PHP
PHP
$data = array (
  'ble_controller' => 'string',
  'key' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'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}/virtual-keys/{key}', false, $context);