Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt

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

Retrieves a single Curso by its primary key. In addition to the base course data, this endpoint resolves the full Usuario objects for every enrolled user by forwarding the request’s Authorization header to msvc-usuarios via an OpenFeign call to GET /usuarios-por-curso. The populated usuarios array is returned in the response alongside the raw cursoUsuarios junction entries. Authentication required. The Authorization header must be present and will be forwarded to msvc-usuarios to authenticate the downstream user-lookup call.

Endpoint

GET http://localhost:8002/{id}
Via API Gateway:
GET http://localhost:8090/api/cursos/{id}

Path Parameters

id
number
required
The primary key (id) of the course to retrieve.

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer token forwarded to msvc-usuarios when fetching enrolled user details.

Response

200 OK — The Curso object with the usuarios array populated.
id
number
Primary key of the course.
nombre
string
Name of the course.
cursoUsuarios
array
Raw junction records from the cursos_usuarios table.
cursoUsuarios[].id
number
Primary key of the CursoUsuario junction record.
cursoUsuarios[].usuarioId
number
The ID of the enrolled user as stored in msvc-usuarios.
usuarios
array
Full Usuario objects fetched from msvc-usuarios that correspond to each cursoUsuarios entry. Empty if the course has no enrollments.
usuarios[].id
number
Primary key of the user in msvc-usuarios.
usuarios[].nombre
string
Full name of the user.
usuarios[].email
string
Email address of the user.
usuarios[].password
string
Hashed password of the user as stored in msvc-usuarios.

404 Not Found — Returned when no course with the given id exists.

Examples

Request

curl http://localhost:8002/1 \
  -H "Authorization: Bearer <your-token>"

Response — 200 OK

{
  "id": 1,
  "nombre": "Spring Boot 3",
  "cursoUsuarios": [
    { "id": 1, "usuarioId": 3 },
    { "id": 2, "usuarioId": 7 }
  ],
  "usuarios": [
    {
      "id": 3,
      "nombre": "Carlos López",
      "email": "carlos@example.com",
      "password": "$2a$10$hashed..."
    },
    {
      "id": 7,
      "nombre": "Ana Martínez",
      "email": "ana@example.com",
      "password": "$2a$10$hashed..."
    }
  ]
}

Response — 404 Not Found

(empty body)

The Authorization header is mandatory. The controller declares @RequestHeader(value = "Authorization", required = true), so requests without this header will be rejected by Spring before reaching the service layer. The same token is forwarded verbatim to msvc-usuarios via the Feign client’s obtenerAlumnosPorCurso call.

Build docs developers (and LLMs) love