Skip to main content
POST
/
asistencia
/
iniciar
Start Shift
curl --request POST \
  --url https://api.example.com/asistencia/iniciar \
  --header 'Content-Type: application/json' \
  --data '
{
  "empleadoId": 123,
  "unidadId": 123,
  "foto": "<string>",
  "unidadAsignadaId": 123,
  "hora": "<string>"
}
'
{
  "success": true,
  "data": null,
  "message": "<string>"
}

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

empleadoId
integer
required
The unique identifier of the employee starting their shift
unidadId
integer
required
The ID of the unit/location where the employee is starting their shift
foto
string
Base64-encoded photo of the employee for attendance verification (optional)
unidadAsignadaId
integer
The ID of the employee’s assigned unit (optional)
hora
string
Custom time for shift start in HH:mm:ss format (optional). If not provided, current time is used

Response

success
boolean
Indicates whether the operation was successful
data
null
No data is returned for this endpoint
message
string
Confirmation message: “Jornada iniciada”

Example Request

cURL
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 Response
{
  "success": true,
  "data": null,
  "message": "Jornada iniciada"
}
Error Response
{
  "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

Build docs developers (and LLMs) love