cURL
curl --request GET \ --url https://api.example.com/
{ "status": "<string>", "timestamp": "<string>", "total_dispositivos": 123, "dispositivos": { "ip": "<string>", "name": "<string>" } }
Check server status and get basic information about registered devices
GET /
YYYY-MM-DD HH:MM:SS
Show Device Object
curl -k https://localhost:5000/
{ "status": "online", "timestamp": "2026-03-06 10:30:15", "total_dispositivos": 2, "dispositivos": { "principal": { "ip": "192.168.1.205", "name": "Entrada Principal" }, "bodega": { "ip": "192.168.1.206", "name": "Bodega" } } }
curl http://localhost:5000/
{ "status": "online", "device_ip": "192.168.1.205", "device_port": 4370, "timestamp": "2026-03-06 10:30:15" }
@app.route("/", methods=["GET"]) def health(): return _json({ "status": "online", "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "total_dispositivos": len(DEVICES), "dispositivos": {k: {"ip": v["ip"], "name": v["name"]} for k, v in DEVICES.items()}, })
@app.route("/", methods=["GET"]) def health(): return _json({ "status": "online", "device_ip": ZK_IP, "device_port": ZK_PORT, "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), })