Automatic authentication
Obtains a device token on first use, caches it, and transparently re-authenticates on a 401.
A modern, framework-agnostic PHP SDK for the ZKTeco BioTime REST API — authentication, pagination, DTOs, and Laravel integration, out of the box.
BioTime devices and servers expose a REST API for attendance transactions, employees, devices (terminals), departments, positions, areas, and resignations — but every call needs a bearer token, that token expires, pagination has to be walked by hand, and every response is an untyped array.
BioTime SDK handles all of that for you:
401.list() for a single page and all() to walk every page for you.Employee, Device, AttendanceRecord, with the full raw payload still available via ->raw.ApiException (or AuthenticationException) with the HTTP status and raw response body attached.PHP developers integrating a ZKTeco BioTime device or BioTime server into an HR system, attendance dashboard, payroll pipeline, or any application that needs employee, device, or attendance data — in plain PHP or inside a Laravel app.
TIP
BioTime SDK requires PHP ^8.1 and the ext-json extension. It depends on guzzlehttp/guzzle ^7.0 for HTTP and psr/simple-cache for optional token caching.
composer require tes/biotime-sdkuse BioTime\BioTime;
$biotime = new BioTime(); // reads BIOTIME_* env vars, or config/biotime.php
$employee = $biotime->employees()->find('EMP001');
echo $employee->firstName;That's a full authenticated request — no manual token handling, no manual JSON decoding.
| Resource | What it covers |
|---|---|
| Attendances | Punch/transaction records, date-range queries, CSV/TXT/XLS export |
| Employees | CRUD, area/department reassignment, resignation, biometric templates |
| Devices | Terminal CRUD, reboot, clear commands, upload/resync actions |
| Departments | Department CRUD |
| Positions | Job position CRUD |
| Areas | Area/site CRUD |
| Resignations | Resignation CRUD and reinstatement |
BioTime SDK ships an optional, auto-discovered Laravel service provider. Install the package in a Laravel app and BioTime::class is already bound in the container — no manual registration required. See Laravel integration.