Update Location
Submit location coordinates to record attendance. This endpoint creates a new attendance record with the current timestamp and user’s location.Request Parameters
The latitude coordinate of the user’s current location.Example:
19.432608The longitude coordinate of the user’s current location.Example:
-99.133209Request Format
The endpoint expects JSON-encoded data (Content-Type:application/json).
Response
Always returns “OK” on successful submission.
Success Response
Code Examples
Implementation Details
The endpoint implementation (app.py:116-132):Behavior
When you submit location data:- The system automatically captures the current timestamp
- The date is stored in
YYYY-MM-DDformat - The time is stored in
HH:MM:SSformat (24-hour) - The record is associated with the authenticated user (
current_user.id) - The data is appended to
data/registros.json
Attendance Status
Records submitted after 08:30:00 are marked as “RETARDO” (late) in the monitoring dashboard. Records submitted at or before 08:30:00 are marked as “PUNTUAL” (on time).Data Persistence
All location records are stored indata/registros.json with the following structure: