Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt

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

The /api/participantes/** routes manage the social profile layer of Spring Community. Every endpoint in this group requires a valid, non-expired ACCESS token passed as a Bearer header. A participant is the in-app social identity tied to a registered user account — it holds the display name, event memberships, friend list, and profile image. Participant IDs and User IDs are distinct; the usuarioId field on a participant record links back to the underlying authentication account.
Participant IDs are separate from User IDs. A participant’s usuarioId links back to the user account created during registration. Always use the participant id when calling participant-scoped endpoints.

GET /api/participantes — List all participants

Returns the full list of registered participants as an array of ParticipanteDTO objects. Useful for administrative views or seeding a user-search UI before the user has typed anything. Authentication: Bearer token required.

Response fields

id
Long
required
Unique identifier for the participant record.
nombreParticipante
string
required
The participant’s display name. Must be between 6 and 20 characters.
eventosId
array of Long
required
IDs of all events the participant has joined as a member.
eventosAdministradosId
array of Long
required
IDs of all events the participant administers.
usuarioId
Long
required
ID of the linked user account (authentication identity).
imagenParticipante
string
required
Filename of the participant’s profile image. Defaults to "default.png" if no custom image has been uploaded.

Response example

[
  {
    "id": 1,
    "nombreParticipante": "alice92",
    "eventosId": [10, 14],
    "eventosAdministradosId": [14],
    "usuarioId": 5,
    "imagenParticipante": "avatar_alice.png"
  },
  {
    "id": 2,
    "nombreParticipante": "bobsmith",
    "eventosId": [10],
    "eventosAdministradosId": [],
    "usuarioId": 6,
    "imagenParticipante": "default.png"
  }
]

curl

curl -X GET http://localhost:8080/api/participantes \
  -H "Authorization: Bearer <accessToken>"

GET /api/participantes/{id} — Get participant by ID

Retrieves the ParticipanteDTO for a single participant identified by their numeric ID. Returns 404 if no participant with that ID exists, and 401 if the token is missing or invalid. Authentication: Bearer token required.

Path parameters

id
Long
required
The unique numeric ID of the participant to retrieve.

Response fields

Same fields as List all participants: id, nombreParticipante, eventosId, eventosAdministradosId, usuarioId, imagenParticipante.

Response example

{
  "id": 1,
  "nombreParticipante": "alice92",
  "eventosId": [10, 14],
  "eventosAdministradosId": [14],
  "usuarioId": 5,
  "imagenParticipante": "avatar_alice.png"
}

Error responses

StatusCondition
401 UnauthorizedToken is missing, expired, or has an invalid signature.
404 Not FoundNo participant exists with the given id.

curl

curl -X GET http://localhost:8080/api/participantes/1 \
  -H "Authorization: Bearer <accessToken>"

GET /api/participantes/amigos — List authenticated user’s friends

Returns the friend list of the currently authenticated participant as a set of ParticipanteAmigoDTO objects. The caller is identified by the token — no additional parameter is needed. Authentication: Bearer token required.

Response fields

id
Long
required
Unique identifier of the friend participant.
nombreParticipante
string
required
Display name of the friend.
amigosId
set of Long
required
IDs of participants who are friends of this friend (their own friend list).
usuarioId
Long
required
ID of the friend’s linked user account.

Response example

[
  {
    "id": 2,
    "nombreParticipante": "bobsmith",
    "amigosId": [1, 7],
    "usuarioId": 6
  },
  {
    "id": 7,
    "nombreParticipante": "carlos_g",
    "amigosId": [1],
    "usuarioId": 11
  }
]

curl

curl -X GET http://localhost:8080/api/participantes/amigos \
  -H "Authorization: Bearer <accessToken>"

GET /api/participantes/amigos/{id} — Get a specific friend’s profile

Fetches the ParticipanteAmigoDTO for one specific friend by their participant ID. This endpoint exposes the friend’s own friend list (amigosId) in addition to the basic profile, which makes it suitable for rendering a mutual-friends UI. Authentication: Bearer token required.

Path parameters

id
Long
required
The participant ID of the friend whose profile you want to retrieve.

Response fields

Same fields as List friends: id, nombreParticipante, amigosId, usuarioId.

Response example

{
  "id": 2,
  "nombreParticipante": "bobsmith",
  "amigosId": [1, 7],
  "usuarioId": 6
}

curl

curl -X GET http://localhost:8080/api/participantes/amigos/2 \
  -H "Authorization: Bearer <accessToken>"

GET /api/participantes/amigos/mostrar — Search for potential friends

Performs a partial-name search across all participants and returns those whose nombreParticipante matches the provided input string. Intended for the friend-search autocomplete feature. Authentication: Bearer token required.

Query parameters

input
string
required
Partial display name to search for. Case handling is determined by the underlying service query. Submit at least one character.

Response fields

Returns a set of ParticipanteDTO objects (same shape as List all participants).

Response example

[
  {
    "id": 7,
    "nombreParticipante": "carlos_g",
    "eventosId": [10],
    "eventosAdministradosId": [],
    "usuarioId": 11,
    "imagenParticipante": "default.png"
  }
]

curl

curl -X GET "http://localhost:8080/api/participantes/amigos/mostrar?input=carlos" \
  -H "Authorization: Bearer <accessToken>"

POST /api/participantes/amigos/add/{id} — Add a friend

Adds the participant identified by id to the authenticated user’s friend list. The operation is idempotent in the sense that attempting to add a participant who is already a friend, or attempting to add yourself, will result in a 422 Unprocessable Content error rather than a silent no-op. Authentication: Bearer token required.

Path parameters

id
Long
required
The participant ID of the person to add as a friend.

Response

200 OK with an empty body on success.

Error responses

StatusCondition
401 UnauthorizedToken is missing, expired, or has an invalid signature.
422 Unprocessable ContentThe target participant cannot be added — possible reasons include attempting to add yourself (agregarAmigo rejects amigo.equals(this)) or the relationship violating a business rule enforced by ParticipanteException.

curl

curl -X POST http://localhost:8080/api/participantes/amigos/add/2 \
  -H "Authorization: Bearer <accessToken>"

POST /api/participantes/imagen — Upload profile image

Replaces the authenticated participant’s profile image with the uploaded file. The request must be sent as multipart/form-data with a single part named image. The service layer enforces a maximum file size of 5 MB; larger files will be rejected with a 400 Bad Request. Authentication: Bearer token required. Content-Type: multipart/form-data

Request parts

image
file
required
The image file to set as the participant’s profile picture. Maximum size: 5 MB. Common accepted formats are JPEG and PNG. Stored under the participant’s record as imagenParticipante.

Response

200 OK with an empty body on success.

Error responses

StatusCondition
400 Bad RequestThe file exceeds 5 MB or is otherwise invalid (handled by StorageException).
401 UnauthorizedToken is missing, expired, or has an invalid signature.
After a successful upload, retrieve the updated filename by calling GET /api/participantes/{id} and reading the imagenParticipante field. Serve the image from the static file route configured in your storage layer.

curl

curl -X POST http://localhost:8080/api/participantes/imagen \
  -H "Authorization: Bearer <accessToken>" \
  -F "image=@/path/to/your/photo.jpg"

Build docs developers (and LLMs) love