Overview
This endpoint registers the start of an employee’s work shift. It captures the employee’s photo, location (unit), and timestamp to mark the beginning of their workday.
Request Body
The unique identifier of the employee starting their shift
The ID of the unit/location where the employee is starting their shift
Base64-encoded photo of the employee for attendance verification (optional)
The ID of the employee’s assigned unit (optional)
Custom time for shift start in HH:mm:ss format (optional). If not provided, current time is used
Response
Indicates whether the operation was successful
No data is returned for this endpoint
Confirmation message: “Jornada iniciada”
Example Request
curl -X POST https://api.integra.com/asistencia/iniciar \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"empleadoId": 123,
"unidadId": 5,
"foto": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"unidadAsignadaId": 5,
"hora": "08:00:00"
}'
Response Example
{
"success": true,
"data": null,
"message": "Jornada iniciada"
}
{
"success": false,
"message": "El ID del empleado no puede ser nulo"
}
Business Rules
- An employee cannot start a shift if they already have an active shift in progress
- The
empleadoId and unidadId are mandatory fields
- If
hora is not provided, the system uses the current server time
- The photo field is optional but recommended for attendance verification
- Unit validation ensures the employee is starting their shift at a valid location