Skip to main content

Overview

The Integra API provides comprehensive endpoints for managing employee attendance including shift start/end, break management, manual entries, and photo capture for verification.

Starting a Shift

To start an employee’s work shift, use the /asistencia/iniciar endpoint with the employee’s information and optional photo.
1

Prepare the request

Create a POST request with the employee ID, unit ID, and optional photo capture.Endpoint: POST /asistencia/iniciarRequest Body:
{
  "empleadoId": 123,
  "unidadId": 5,
  "foto": "base64_encoded_photo_string",
  "unidadAsignadaId": 5,
  "hora": "08:00:00"
}
Required Fields:
  • empleadoId - Employee ID (required)
  • unidadId - Unit/location ID where attendance is recorded (required)
Optional Fields:
  • foto - Base64 encoded photo for verification
  • unidadAsignadaId - Assigned unit ID
  • hora - Time of registration (LocalTime format)
2

Send the request

Execute the curl command:
curl -X POST https://api.example.com/asistencia/iniciar \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "empleadoId": 123,
    "unidadId": 5,
    "hora": "08:00:00"
  }'
3

Handle the response

Success Response (200 OK):
{
  "data": null,
  "message": "Jornada iniciada"
}
The shift has been successfully started and recorded in the system.

Ending a Shift

When an employee finishes their work shift, use the /asistencia/finalizar endpoint.
1

Prepare the end shift request

Endpoint: POST /asistencia/finalizarRequest Body:
{
  "empleadoId": 123,
  "unidadId": 5,
  "foto": "base64_encoded_photo_string",
  "finDeposito": false,
  "unidadAsignadaId": 5
}
Fields:
  • empleadoId - Employee ID (required)
  • unidadId - Unit ID (required)
  • foto - Photo capture (optional)
  • finDeposito - Boolean flag for deposit completion
  • unidadAsignadaId - Assigned unit ID
2

Execute the request

curl -X POST https://api.example.com/asistencia/finalizar \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "empleadoId": 123,
    "unidadId": 5,
    "finDeposito": false
  }'
3

Verify completion

Success Response:
{
  "data": null,
  "message": "Jornada finalizada"
}

Managing Breaks

Starting a Break

Employees can start different types of breaks (meal breaks, other breaks) during their shift.
1

Initiate a break

Endpoint: POST /asistencia/pausa/iniciarRequest Body:
{
  "empleadoId": 123,
  "unidadId": 5,
  "pausa": "COMIDA",
  "foto": "base64_encoded_photo_string",
  "unidadAsignadaId": 5
}
Break Types (pausa field):
  • COMIDA - Meal break
  • OTRA - Other break type
curl -X POST https://api.example.com/asistencia/pausa/iniciar \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "empleadoId": 123,
    "unidadId": 5,
    "pausa": "COMIDA"
  }'
2

Receive confirmation

Success Response:
{
  "data": null,
  "message": "Pausa iniciada"
}

Ending a Break

When the employee returns from their break, finalize it with the corresponding endpoint.
1

End the break

Endpoint: POST /asistencia/pausa/finalizarRequest Body:
{
  "empleadoId": 123,
  "unidadId": 5,
  "pausa": "COMIDA",
  "foto": "base64_encoded_photo_string"
}
curl -X POST https://api.example.com/asistencia/pausa/finalizar \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "empleadoId": 123,
    "unidadId": 5,
    "pausa": "COMIDA"
  }'
2

Verify break completion

Success Response:
{
  "data": null,
  "message": "Pausa registrada"
}

Manual Attendance Entry

For corrections or backdated entries, administrators can manually register attendance records.
1

Prepare manual entry

Endpoint: POST /asistencia/manualRequest Body:
{
  "empleadoId": 123,
  "tipoAccion": "iniciarJornada",
  "hora": "08:30:00",
  "observaciones": "Registro manual por falla en kiosco",
  "unidadId": 5,
  "pausa": "COMIDA",
  "unidadAsignadaId": 5
}
Action Types (tipoAccion):
  • iniciarJornada - Start shift manually
  • finalizarJornada - End shift manually
  • finalizarJornadaDeposito - End shift with deposit
  • iniciarPausa - Start break manually
  • finalizarPausa - End break manually
Required Fields:
  • empleadoId - Employee ID
  • tipoAccion - Action type
  • hora - Time of action (LocalTime format: HH:mm:ss)
  • observaciones - Observations/notes explaining the manual entry
  • unidadId - Unit ID
2

Submit manual entry

curl -X POST https://api.example.com/asistencia/manual \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "empleadoId": 123,
    "tipoAccion": "iniciarJornada",
    "hora": "08:30:00",
    "observaciones": "Registro manual por falla en kiosco",
    "unidadId": 5
  }'
3

Confirm registration

Success Response:
{
  "data": null,
  "message": "Asistencia registrada"
}

Photo Capture Guidelines

When including photos in attendance records:
  • Format: Base64 encoded string
  • Purpose: Employee verification and attendance validation
  • Field: foto parameter in request body
  • Usage: Optional but recommended for shift start/end and breaks
Example photo integration:
{
  "empleadoId": 123,
  "unidadId": 5,
  "foto": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD..."
}

Updating and Deleting Records

Update Shift Record

Endpoint: PUT /asistencia/jornada Update an existing shift record with new information.

Update Break Record

Endpoint: PUT /asistencia/pausa Modify break information for an employee.

Delete Shift

Endpoint: DELETE /asistencia/jornada/{id}
curl -X DELETE https://api.example.com/asistencia/jornada/456 \
  -H "Authorization: Bearer YOUR_TOKEN"

Delete Break

Endpoint: DELETE /asistencia/pausa/{id}
curl -X DELETE https://api.example.com/asistencia/pausa/789 \
  -H "Authorization: Bearer YOUR_TOKEN"

Reference

Controller: AsistenciaCommandController.java at /asistencia/controller/AsistenciaCommandController.java:1 Related DTOs:
  • RegistroDTO.java - Standard attendance registration
  • RegistroManualDTO.java - Manual attendance entry
  • ActualizarJornadaDTO.java - Update shift records
  • ActualizarPausaDTO.java - Update break records

Next Steps

Reports Generation

Generate attendance reports and export to Excel

Employee Management

Manage employee information and assignments

Build docs developers (and LLMs) love