Skip to main content
GET
/
secured
/
getBitacora
Get Activity Log
curl --request GET \
  --url https://api.example.com/secured/getBitacora
{
  "status": 123,
  "bitacora": [
    {
      "fecha": "<string>",
      "modificacion": "<string>",
      "tipoUsuario": "<string>",
      "correo": "<string>",
      "Nombre": "<string>",
      "cantidad": 123
    }
  ],
  "401 Unauthorized": {}
}

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header.

Overview

The activity log (bitacora) tracks all significant actions performed in the system, including product publications and other modifications. This endpoint returns the activity log joined with user information.

Response

status
number
HTTP status code (200 for success)
bitacora
array
Array of activity log entries
curl --location 'http://localhost:8080/secured/getBitacora' \
--header 'Authorization: YOUR_JWT_TOKEN'

Response Example

{
  "status": 200,
  "bitacora": [
    {
      "fecha": "2026-03-05",
      "modificacion": "Publicación de productos",
      "tipoUsuario": "admin",
      "correo": "[email protected]",
      "Nombre": "Juan Pérez",
      "cantidad": 15
    },
    {
      "fecha": "2026-03-04",
      "modificacion": "Publicación de productos",
      "tipoUsuario": "user",
      "correo": "[email protected]",
      "Nombre": "María González",
      "cantidad": 8
    }
  ]
}

Error Responses

401 Unauthorized
object
Returned when the JWT token is invalid or missing
{
  "msg": "Token_invalido"
}
or
{
  "msg": "Sin autorización"
}

Implementation Details

The endpoint performs a SQL join between the bitacora and usuarios tables:
SELECT 
  B.fecha, 
  B.modificacion, 
  U.tipoUsuario,
  U.correo, 
  CONCAT_WS(" ", U.nombre, U.apellido) as Nombre, 
  B.cantidad 
FROM bitacora as B 
INNER JOIN usuarios as U ON B.idUsuarioB = U.id

Use Cases

  • Audit Trail: Track all user actions and modifications in the system
  • Compliance: Maintain records of who did what and when
  • Analytics: Analyze user activity patterns and productivity
  • Troubleshooting: Investigate issues by reviewing historical actions

Build docs developers (and LLMs) love