Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Esteban-Mendez-j/Proyecto-Docker/llms.txt

Use this file to discover all available pages before exploring further.

The Notifications API delivers in-app alerts to users when meaningful events occur—such as a new chat message, an application status change, or a company action on a vacancy. Notifications are available through paginated REST endpoints for inbox management and via a WebSocket subscription for live delivery without polling.

When notifications are triggered

Notifications are created in two ways:
  • WebSocket push — any backend process or another connected client sends a NotificacionDTO to /app/enviar/notificacion or /app/enviar/evento. The server persists the notification and routes it to the recipient’s private queue.
  • Direct service call — server-side services (for example, application status transitions) call NotificacionService.Create internally and then push over WebSocket.
Each notification has an estadoEnvio field that moves from ENVIADO (sent) to RECIBIDO (acknowledged) once the client marks it as received.

REST endpoints

All endpoints are under /api/notificaciones and require the jwtToken cookie for authentication. The authenticated user’s ID is extracted from the JWT on every request.

Get received notifications (paginated)

Returns the authenticated user’s visible received notifications, newest first.
GET /api/notificaciones/recibidas?page=0&size=10
Cookie: jwtToken=<token>
page
integer
default:"0"
Zero-based page number.
size
integer
default:"10"
Number of notifications per page.
Response — paginated map with content array of NotificacionDTO objects and standard Spring Page metadata.
CodeMeaning
200Success.
401Missing or invalid jwtToken cookie.

Get recent received notifications

Returns a flat list of the most recent received notifications with estadoEnvio = ENVIADO. Intended for notification badge counts and preview dropdowns.
GET /api/notificaciones/recibidas/recientes
Cookie: jwtToken=<token>
Response body
notificaciones
NotificacionDTO[]
Array of recent unacknowledged notifications.
CodeMeaning
200Success.
401Missing or invalid jwtToken cookie.

Get sent notifications (paginated)

Returns the authenticated user’s visible sent notifications.
GET /api/notificaciones/enviadas?page=0&size=10
Cookie: jwtToken=<token>
page
integer
default:"0"
Zero-based page number.
size
integer
default:"10"
Number of notifications per page.
Response — paginated map identical in shape to the received notifications response.
CodeMeaning
200Success.
401Missing or invalid jwtToken cookie.

Mark a notification as received

Transitions a notification’s estadoEnvio from ENVIADO to RECIBIDO. Call this once the client has acknowledged delivery.
PUT /api/notificaciones/edit/estadoEnvio/{id}
id
string
required
The notification’s unique identifier.
Response body
{ "status": 200 }
CodeMeaning
200State updated successfully.

Update notification visibility

Hides or restores a notification. Setting visibilidad=false removes it from the recipient’s inbox.
PUT /api/notificaciones/edit/visibilidad/{id}?visibilidad=false
id
string
required
The notification’s unique identifier.
visibilidad
boolean
required
true to show the notification; false to hide it.
Response body
{ "status": 200 }
Visibility is a single shared flag. If one party hides the notification, it becomes invisible to both sender and recipient. This is a known limitation tracked in the source code.
CodeMeaning
200Visibility updated successfully.

Data model

NotificacionDTO fields

id
string
Unique notification identifier.
asunto
string
Subject line of the notification.
cuerpo
string
Full body text of the notification.
fechaEnvio
string (ISO 8601 datetime)
Timestamp when the notification was sent.
destinatario
string
Email address (or user identifier) of the recipient.
remitente
string
Email address (or user identifier) of the sender.
idRemitente
integer
Numeric user ID of the sender.
idVacante
integer
ID of the vacancy this notification relates to, if applicable.
nameRemitente
string
Display name of the sender.
isVisible
boolean
Whether the notification is visible to both parties.
estadoEnvio
string
ENVIADO when first delivered; RECIBIDO after the client acknowledges it.

Real-time delivery via WebSocket

Notifications are pushed in real time over the same STOMP/SockJS connection used by the Chat API (endpoint /chats). See Chat API — connecting for how to establish the connection.

Send a notification

Publish to /app/enviar/notificacion. The server persists the notification via NotificacionService.Create and immediately delivers it to the recipient’s queue.
stompClient.publish({
  destination: '/app/enviar/notificacion',
  body: JSON.stringify({
    asunto: 'Your application has been reviewed',
    cuerpo: 'The company has moved your application to the next stage.',
    destinatario: 'candidate@example.com',
    remitente: 'company@example.com',
    idRemitente: 5,
    idVacante: 42,
    nameRemitente: 'Acme Corp',
  }),
});
Destination summary
DirectionDestination
Client sends to/app/enviar/notificacion
Recipient receives at/user/{destinatario}/queue/notificacion

Send an event notification

Use /app/enviar/evento when you need to deliver the same notification to both the main notification inbox and a separate event channel. The server does not persist this notification—it routes it directly over WebSocket.
stompClient.publish({
  destination: '/app/enviar/evento',
  body: JSON.stringify({
    asunto: 'New message received',
    cuerpo: 'You have a new message from Acme Corp.',
    destinatario: 'candidate@example.com',
  }),
});
Destination summary
DirectionDestination
Client sends to/app/enviar/evento
Recipient receives at (inbox)/user/{destinatario}/queue/notificacion
Recipient receives at (events)/user/{destinatario}/queue/notificacion/evento

Subscribing to notifications

import { connect, subscribe } from './services/Websocket';

// Main notification inbox
subscribe('/user/queue/notificacion', (msg) => {
  const notification = JSON.parse(msg.body);
  console.log('New notification:', notification.asunto);
});

// Event-only channel
subscribe('/user/queue/notificacion/evento', (msg) => {
  const event = JSON.parse(msg.body);
  console.log('Event:', event.asunto);
});

connect();
After receiving a notification over WebSocket, call PUT /api/notificaciones/edit/estadoEnvio/{id} to mark it as RECIBIDO and clear it from the unread count.

Build docs developers (and LLMs) love