26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Extend key validity

Extend a BLE key validity

PUT  /api/v1/billing/access-points/{access_point}/ble-controllers/{ble_controller}/keys/{key}

Updates the key expiration date (valid_till) and regenerates the access token (key_data).

JSON
{
    "valid_till": "2024-03-01T00:00:00Z",
    "floor": 3
}

Method parameters

string access_point  required , (path) Access point UUID.


string ble_controller  required , (path) UUID of the BLE controller used to generate the token.


integer key  required , (path) User BLE key ID.


string valid_till  required , New key expiration date and time.


string floor, Floor encoded in the token. Number or string. Default: 0.

200  OK

Key updated successfully

JSON
{
    "data": {
        "id": 1,
        "intercom_id": 10,
        "user_id": 42,
        "intercom_flat_id": null,
        "type": "ble",
        "key": null,
        "title": null,
        "key_data": "0102030405060708090a0b0c0d0e0f10",
        "valid_till": "2024-03-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at": "2024-01-01T00:00:00.000000Z"
    }
}

404  Not Found

Key not found

422  Unprocessable Entity

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

JSON
{
    "message": "Validation failed",
    "errors": {
        "valid_till": [
            "The valid till field must be a valid date."
        ]
    }
}
cURL
Bash
curl -k --request PUT \
	--url 'https://your-domain/api/v1/billing/access-points/{access_point}/ble-controllers/{ble_controller}/keys/{key}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "access_point": "string",
    "ble_controller": "string",
    "key": "integer",
    "valid_till": "string",
    "floor": "string"
}'
PHP
PHP
$data = array (
  'access_point' => 'string',
  'ble_controller' => 'string',
  'key' => 'integer',
  'valid_till' => 'string',
  'floor' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PUT',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/access-points/{access_point}/ble-controllers/{ble_controller}/keys/{key}', false, $context);