Middleware service that retrieves access control events from HikCentral Professional (Artemis OpenAPI) and sends time tracking records to Humand (clock-in / clock-out).
This project integrates:
- 🎥 HikCentral Professional (Artemis OpenAPI)
- 🔐 Access Control / Facial Recognition devices
- 👥 Humand Time Tracking API
- 🧠 Python middleware service
The service polls or subscribes to Hikvision access events and forwards them to Humand as clock-in / clock-out records.
Hikvision Devices (Facial / Card Reader)
│
▼
HikCentral Professional (Artemis API)
│
▼
Python Middleware
│
▼
Humand API
(time-tracking/clock-in / clock-out)
Uses HMAC SHA256 signature.
Required headers:
x-ca-key
x-ca-signature
Accept: */*
Content-Type: application/json
Signature string format example:
POST
*/*
x-ca-key:{APP_KEY}
/artemis/api/...
Uses Basic Authentication:
Authorization: Basic <BASE64_TOKEN>
POST /time-tracking/clock-in
POST /time-tracking/clock-out
GET /public/api/v1/users
Example request body:
{
"employeeId": "43013830",
"now": "2026-01-27T08:12:45.123-03:00",
"comment": "Hikvision facial entry"
}- Python 3.10+
- pip
Install dependencies:
pip install -r requirements.txtIf needed:
pip install requestsCreate a .env file (recommended):
HIKVISION_HOST=https://192.168.4.252
HIK_APP_KEY=your_app_key
HIK_SECRET=your_secret
HUMAND_BASE_URL=https://api-prod.humand.co
HUMAND_AUTH=Basic xxxxxxxxx
⚠ Never commit real credentials to GitHub. <- Recordatorio
python main.pyOr via scheduler:
python scheduler.pyRecommended polling interval:
- Every 5–10 minutes
Install the project requirements and execute pytest:
pip install -r requirements.txt
pytest -qCreate a .env based on .env.example, enable DRY_RUN=true for safe testing, then:
python webhook_server.py| Hikvision Field | Humand Field |
|---|---|
| personId | employeeInternalId |
| eventTime | now |
| Entry device | clock-in |
| Exit device | clock-out |
- No bulk requests (1 record per request)
- Entries must alternate:
clock-in → clock-out → clock-in → clock-out
Common errors:
| Code | Description |
|---|---|
| 200 | Success |
| 422 | Future entry |
| 422 | Duplicate entry |
| 422 | Entry without exit |
The middleware logs:
- Events processed
- Requests sent to Humand
- API responses
- Signature errors
- Mapping failures
- Not all facial recognition events are exposed via OpenAPI.
- AI endpoints may require additional licensing.
- Direct SQL Server access is unsupported and not recommended.
- Use environment variables.
- Restrict network access to HikCentral.
- Validate HTTPS certificates in production.
- Do not store tokens in repository.
- Local cache database
- Retry queue system
- Docker container
- Health-check endpoint
- Monitoring dashboard
- Unit tests
Integration Middleware
Access Control → HR Time Tracking System