Skip to main content
GET
/
api
/
recognition
/
wall
/
:hospitalId
Recognition Wall
curl --request GET \
  --url https://api.example.com/api/recognition/wall/:hospitalId
{
  "success": true,
  "message": "<string>",
  "data.recognitions": [
    {
      "_id": "<string>",
      "employeeId": {
        "_id": "<string>",
        "personalInfo.name": "<string>",
        "jobInfo.position": "<string>",
        "jobInfo.department": "<string>"
      },
      "recognitionType": "<string>",
      "rewardType": "<string>",
      "title": "<string>",
      "description": "<string>",
      "pointsAwarded": 123,
      "badgeEarned": "<string>",
      "issuedAt": "<string>"
    }
  ]
}

Overview

Retrieve a public feed of recent recognitions for a specific hospital. This creates a “recognition wall” to celebrate employee achievements and foster team motivation.

Authentication

This endpoint requires authentication.
Authorization: Bearer YOUR_JWT_TOKEN

Endpoint

GET /api/recognition/wall/:hospitalId

Path Parameters

hospitalId
string
required
The unique identifier of the hospital

Query Parameters

limit
number
Maximum number of recognitions to return. Default: 10

Response

success
boolean
Indicates if the request was successful
message
string
Response message
data.recognitions
array
Array of public recognition objects, sorted by most recent first

Examples

curl -X GET "https://api.cuido.com/api/recognition/wall/HOSPITAL_001?limit=10" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response Example

{
  "success": true,
  "message": "Muro de reconocimiento obtenido",
  "data": {
    "recognitions": [
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e7",
        "employeeId": {
          "_id": "65a1b2c3d4e5f6a7b8c9d0e2",
          "personalInfo": {
            "name": "María García"
          },
          "jobInfo": {
            "position": "enfermero",
            "department": "urgencias"
          }
        },
        "recognitionType": "empleado_mes",
        "rewardType": "mencion",
        "title": "¡Empleado del Mes!",
        "description": "Reconocimiento por tu excelente desempeño",
        "pointsAwarded": 100,
        "badgeEarned": "estrella",
        "issuedAt": "2024-01-15T10:30:00.000Z"
      },
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e8",
        "employeeId": {
          "_id": "65a1b2c3d4e5f6a7b8c9d0e3",
          "personalInfo": {
            "name": "Carlos López"
          },
          "jobInfo": {
            "position": "medico",
            "department": "hospitalizacion"
          }
        },
        "recognitionType": "curso_terminado",
        "rewardType": "diploma",
        "title": "¡Curso Completado!",
        "description": "Has terminado exitosamente tu capacitación",
        "pointsAwarded": 20,
        "badgeEarned": "aprendiz",
        "issuedAt": "2024-01-14T15:20:00.000Z"
      },
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e9",
        "employeeId": {
          "_id": "65a1b2c3d4e5f6a7b8c9d0e4",
          "personalInfo": {
            "name": "Ana Martínez"
          },
          "jobInfo": {
            "position": "auxiliar_enfermeria",
            "department": "urgencias"
          }
        },
        "recognitionType": "encuesta_completada",
        "rewardType": "puntos",
        "title": "¡Encuesta Completada!",
        "description": "Gracias por compartir tu feedback semanal",
        "pointsAwarded": 5,
        "badgeEarned": "participativo",
        "issuedAt": "2024-01-14T09:15:00.000Z"
      }
    ]
  }
}

Privacy & Filtering

The recognition wall service (src/services/recognitionService.js:73) implements:
  • Public Only: Only shows recognitions where isPublic = true
  • Hospital Filter: Matches employees to their hospitalId
  • Recent First: Sorted by issuedAt in descending order
  • Populated Data: Includes employee name, position, and department

Use Cases

  1. Dashboard Display: Show recent recognitions on hospital dashboard
  2. Team Motivation: Public celebration of achievements
  3. Gamification: Encourage participation through visibility
  4. Culture Building: Reinforce organizational values

Error Responses

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

Implementation Notes

The wall uses MongoDB’s population feature:
  1. Query recognitions with isPublic = true
  2. Populate employeeId with employee details
  3. Filter by matching hospitalId in populated employee
  4. Sort by issuedAt descending
  5. Limit results to requested amount

Frontend Integration

Consider implementing:
  • Auto-refresh: Poll endpoint every 30-60 seconds for live updates
  • Animations: Celebrate new recognitions with visual effects
  • Filters: Allow filtering by department or recognition type
  • Social Sharing: Enable employees to share their recognitions

Source Code References

  • Route: src/routes/recognitionRoutes.js:18
  • Controller: src/controllers/recognitionController.js:15
  • Service: src/services/recognitionService.js:73
  • Model: src/models/Recognition.js

Build docs developers (and LLMs) love