26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Create BLE controller

Create a BLE controller

POST  /api/v1/billing/ble-controllers

Creates a BLE controller (Openy). The title and model fields are set automatically (model = OPENYLOCK v.3, title = OPENYLOCK v.3 | <random code>). The type is used only for validation and isn't stored.

JSON
{
    "type": "openy",
    "sid": "EFGH5678",
    "pid": "ABCD1234",
    "master": "AABBCCDDEEFF00"
}

Method parameters

string type  required , Device type (validation only, not stored). Allowed values: `openy`, `generic`.


string sid  required , Device system identifier (System ID). At least 8 characters. Must be unique.


string pid  required , Device identifier (Product ID). At least 8 characters.


string master  required , Device master key. At least 12 characters.

200  OK

BLE controller created successfully

JSON
{
    "uuid": "00000000-0000-0000-0000-000000000001",
    "title": "OPENYLOCK v.3 | k7Qz2",
    "model": "OPENYLOCK v.3",
    "sid": "EFGH5678",
    "pid": "ABCD1234",
    "master": "AABBCCDDEEFF00",
    "online_status": null,
    "deleted_by": null,
    "deleted_at": null,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
}

422  Unprocessable Entity

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

JSON
{
    "message": "Validation failed",
    "errors": {
        "sid": [
            "The sid has already been taken."
        ]
    }
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/ble-controllers' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "type": "string",
    "sid": "string",
    "pid": "string",
    "master": "string"
}'
PHP
PHP
$data = array (
  'type' => 'string',
  'sid' => 'string',
  'pid' => 'string',
  'master' => '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', false, $context);