Devices
Manage ZKTeco devices connected to the platform.
List Devices
Retrieve a list of connected devices.
Endpoint: GET /public/v2/devices
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/devices" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/devices", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Get Device
Retrieve details of a specific device.
Endpoint: GET /public/v2/devices/:id
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/devices/2" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/devices/2", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Create Device
Register a new device.
Endpoint: POST /public/v2/devices
- cURL
- JavaScript
curl -X POST "https://api.biosensei.io/public/v2/devices" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Main Entrance Device",
"serial_number": "SN123456789",
"company_id": 4
}'
const response = await fetch("https://api.biosensei.io/public/v2/devices", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Main Entrance Device",
serial_number: "SN123456789",
company_id: 4
})
});
const data = await response.json();
console.log(data);
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Friendly name for the device. |
serial_number | string | Yes | The Serial Number of the physical ZKTeco device. |
company_id | integer | Yes | ID of the company owning the device. |
Update Device
Update device details.
Endpoint: PUT /public/v2/devices/:id
- cURL
- JavaScript
curl -X PUT "https://api.biosensei.io/public/v2/devices/4" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Main Entrance Device Updated",
"serial_number": "SN123456789",
"company_id": 4
}'
const response = await fetch("https://api.biosensei.io/public/v2/devices/4", {
method: "PUT",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Main Entrance Device Updated",
serial_number: "SN123456789",
company_id: 4
})
});
const data = await response.json();
console.log(data);