Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Rubick65/calenderyBack/llms.txt

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

Overview

The followers API lets authenticated users build and manage a social graph. Every follow action creates a directional Follower relation — one user follows another — while every unfollow action removes it. Both listing endpoints are paginated and support real-time name filtering.

The Follower Domain Entity

A Follower record represents a single directed relationship between two users:
FieldTypeDescription
followerIdLongAuto-generated primary key for the relation
userFollowUserThe user who initiated the follow (the follower)
userFollowedUserThe user being followed (the followee)
The relationship is unidirectional: user A following user B does not imply that user B follows user A.
All write endpoints (follow and unfollow) are guarded by a Spring Security @PreAuthorize("#userId == authentication.principal.idUsuario") expression. This means the idUsuario query parameter must match the ID of the currently authenticated user — you cannot follow or unfollow someone on behalf of another user. Attempting to do so will result in a 403 Forbidden response before the handler is ever reached.

Endpoints

Follow a User

PUT /api/follower/app/follow Creates a Follower relation so that idUsuario follows userToFollowId. Required role: ROLE_USER (ownership-checked — see note above)

Query Parameters

ParameterTypeRequiredDescription
idUsuarioLongID of the authenticated user who wants to follow
userToFollowIdLongID of the user to be followed

Responses

StatusDescription
200 OKFollow relation created successfully. Empty body.
403 ForbiddenidUsuario does not match the authenticated user’s ID.

Example

curl -X PUT \
  "https://api.example.com/api/follower/app/follow?idUsuario=42&userToFollowId=99" \
  -H "Authorization: Bearer <your_jwt_token>"

Unfollow a User

DELETE /api/follower/app/unfollow Removes the Follower relation between idUsuario and userToUnFollowId. Required role: ROLE_USER (ownership-checked — see note above)

Query Parameters

ParameterTypeRequiredDescription
idUsuarioLongID of the authenticated user who wants to unfollow
userToUnFollowIdLongID of the user to be unfollowed

Responses

StatusDescription
200 OKUnfollow successful. Empty body.
403 ForbiddenidUsuario does not match the authenticated user’s ID.
406 Not AcceptableUserNotFollowingException — the authenticated user is not currently following the target user.

Example

curl -X DELETE \
  "https://api.example.com/api/follower/app/unfollow?idUsuario=42&userToUnFollowId=99" \
  -H "Authorization: Bearer <your_jwt_token>"

Get a User’s Followers

GET /api/follower/app/getUserFollowers Returns a paginated list of users who follow the specified user, optionally filtered by name. Required role: ROLE_USER

Query Parameters

ParameterTypeRequiredDefaultDescription
idUsuarioLongID of the user whose followers to retrieve
nombreStringName filter (partial match). Pass an empty string to return all followers.
pageint0Zero-based page index
sizeint20Number of results per page
sortStringSort field and direction, e.g. nombre,asc

Response: Page<UserReducedData>

{
  "content": [
    {
      "idUsuario": 7,
      "nombre": "alice",
      "fotoPerfil": "https://cdn.example.com/avatars/signed-url..."
    }
  ],
  "pageable": {
    "pageNumber": 0,
    "pageSize": 10
  },
  "totalElements": 1,
  "totalPages": 1,
  "last": true
}
FieldTypeDescription
idUsuarioLongUnique user identifier
nombreStringUsername / display name
fotoPerfilStringSigned URL for the user’s profile photo

Example

curl -X GET \
  "https://api.example.com/api/follower/app/getUserFollowers?idUsuario=42&nombre=ali&page=0&size=10" \
  -H "Authorization: Bearer <your_jwt_token>"

Get a User’s Following

GET /api/follower/app/getUserFollowing Returns a paginated list of users that the specified user is following, optionally filtered by name. Required role: ROLE_USER

Query Parameters

ParameterTypeRequiredDefaultDescription
idUsuarioLongID of the user whose following list to retrieve
nombreStringName filter (partial match). Pass an empty string to return all.
pageint0Zero-based page index
sizeint20Number of results per page
sortStringSort field and direction, e.g. nombre,asc

Response: Page<UserReducedData>

Same shape as Get a User’s Followers.
{
  "content": [
    {
      "idUsuario": 99,
      "nombre": "bob",
      "fotoPerfil": "https://cdn.example.com/avatars/signed-url..."
    }
  ],
  "pageable": {
    "pageNumber": 0,
    "pageSize": 10
  },
  "totalElements": 1,
  "totalPages": 1,
  "last": true
}

Example

curl -X GET \
  "https://api.example.com/api/follower/app/getUserFollowing?idUsuario=42&nombre=&page=0&size=10" \
  -H "Authorization: Bearer <your_jwt_token>"

Build docs developers (and LLMs) love