Skip to main content

Endpoint

Generates a CSV file containing employee data formatted for the photocheck (fotocheck) system. The response is a downloadable CSV file with employee information required for ID card generation.

Request

Headers

{
  "Content-Type": "application/json"
}

Body Parameters

body
array
required
Array of employee objects to include in the CSV file

Response

Returns a CSV file with the following headers:
ColumnDescriptionFormat
CARGOJob positionText
DIVISIONWork location/divisionText
DNIDocument numberText
APELLIDOFull last name (paternal + maternal)Text
NOMBREFirst nameText

Response Headers

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename=Fotocheck.csv
Content-Length: [file size in bytes]
Despite the Content-Type header indicating a spreadsheet format, the actual file generated is a CSV that can be opened with Excel or imported into photocheck systems.

Example

curl -X POST https://api.kontrak.com/api/excel/download-photocheck \
  -H "Content-Type: application/json" \
  -d '[
    {
      "name": "Juan",
      "lastNameFather": "Pérez",
      "lastNameMother": "García",
      "dni": "12345678",
      "position": "Operario",
      "subDivisionOrParking": "Playa 1"
    },
    {
      "name": "María",
      "lastNameFather": "López",
      "lastNameMother": "Martínez",
      "dni": "87654321",
      "position": "Supervisor",
      "subDivisionOrParking": "Playa 2"
    }
  ]' \
  --output Fotocheck.csv

Sample CSV Output

CARGO,DIVISION,DNI,APELLIDO,NOMBRE
Operario,Playa 1,12345678,Pérez García,Juan
Supervisor,Playa 2,87654321,López Martínez,María

Error Responses

Empty Request Body

{
  "success": false,
  "message": "No se recibieron datos. Debes enviar una lista de empleados."
}

Too Many Employees

{
  "success": false,
  "message": "Máximo 80 empleados por lote"
}

Validation Error

{
  "success": false,
  "message": "Validation error",
  "errors": [
    {
      "field": "position",
      "message": "El cargo es requerido."
    },
    {
      "field": "subDivisionOrParking",
      "message": "sub división requerida"
    }
  ]
}

Notes

  • The output is a CSV file, not an Excel file, despite the filename extension
  • The APELLIDO column combines both paternal and maternal last names with a space
  • File is compatible with most photocheck/ID card printing systems
  • CSV format uses comma as delimiter
  • Headers are in uppercase for system compatibility
  • Minimum 1 employee required, maximum 50 employees per batch
  • File name is always Fotocheck.csv
  • No date formatting required for this endpoint
  • Only basic employee information is needed (no salary, dates, etc.)

Build docs developers (and LLMs) love