Skip to main content
GET
/
api
/
microlearning
/
recommendations
/
:employeeId
Course Recommendations
curl --request GET \
  --url https://api.example.com/api/microlearning/recommendations/:employeeId
{
  "success": true,
  "message": "<string>",
  "data.recommendations": [
    {
      "_id": "<string>",
      "title": "<string>",
      "description": "<string>",
      "area": "<string>",
      "content": {
        "videoUrl": "<string>",
        "audioUrl": "<string>",
        "pdfUrl": "<string>",
        "duration": 123
      },
      "certificationType": "<string>",
      "passingScore": 123,
      "isActive": true
    }
  ]
}

Overview

Get personalized course recommendations for an employee based on their job position, completed courses, and available content.

Authentication

This endpoint requires authentication.
Authorization: Bearer YOUR_JWT_TOKEN

Endpoint

GET /api/microlearning/recommendations/:employeeId

Path Parameters

employeeId
string
required
The MongoDB ObjectId of the employee

Response

success
boolean
Indicates if the request was successful
message
string
Response message
data.recommendations
array
Array of recommended courses (maximum 3)

Recommendation Algorithm

The recommendation service (src/services/microLearningService.js:107) uses the following logic:
  1. Fetch employee data to get their jobInfo.position
  2. Find completed courses by the employee
  3. Query available courses matching:
    • Employee’s position area OR general area
    • isActive = true
  4. Filter out courses already completed
  5. Return top 3 recommendations

Examples

curl -X GET https://api.cuido.com/api/microlearning/recommendations/65a1b2c3d4e5f6a7b8c9d0e2 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response Example

{
  "success": true,
  "message": "Recomendaciones obtenidas",
  "data": {
    "recommendations": [
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e1",
        "title": "Manejo de Emergencias Cardíacas",
        "description": "Aprende las técnicas esenciales para responder efectivamente a emergencias cardíacas en entornos rurales",
        "area": "urgencias",
        "content": {
          "videoUrl": "https://cdn.cuido.com/videos/cardiac-emergencies.mp4",
          "pdfUrl": "https://cdn.cuido.com/pdfs/cardiac-protocol.pdf",
          "duration": 45
        },
        "certificationType": "aprobacion",
        "passingScore": 75,
        "isActive": true
      },
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e5",
        "title": "Comunicación Efectiva con Pacientes",
        "description": "Mejora tus habilidades de comunicación para brindar un mejor servicio",
        "area": "general",
        "content": {
          "audioUrl": "https://cdn.cuido.com/audio/communication-skills.mp3",
          "duration": 30
        },
        "certificationType": "participacion",
        "passingScore": 70,
        "isActive": true
      },
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e6",
        "title": "Prevención de Infecciones Hospitalarias",
        "description": "Protocolos esenciales para prevenir infecciones en entornos hospitalarios",
        "area": "urgencias",
        "content": {
          "videoUrl": "https://cdn.cuido.com/videos/infection-prevention.mp4",
          "pdfUrl": "https://cdn.cuido.com/pdfs/infection-protocol.pdf",
          "duration": 60
        },
        "certificationType": "aprobacion",
        "passingScore": 80,
        "isActive": true
      }
    ]
  }
}

Use Cases

  1. Onboarding: Suggest relevant courses to new employees based on their role
  2. Continuous Learning: Recommend new content to employees who have completed courses
  3. Skills Development: Target specific job positions with relevant training
  4. General Training: Include general courses applicable to all positions

Error Responses

{
  "success": false,
  "message": "No autorizado. Token inválido o expirado."
}

Future Enhancements

The current recommendation system is rule-based. Future versions could incorporate:
  • AI-based recommendations using employee performance data
  • Collaborative filtering based on similar employees’ preferences
  • Skills gap analysis to target specific competencies
  • Learning path creation with sequential course recommendations

Source Code References

  • Route: src/routes/microLearningRoutes.js:27
  • Controller: src/controllers/microLearningController.js:63
  • Service: src/services/microLearningService.js:107
  • Models: src/models/MicroCourse.js, src/models/CourseEnrollment.js

Build docs developers (and LLMs) love