Get Current User Info
curl --request GET \
--url https://api.example.com/users/me \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"id": 123,
"username": "<string>",
"email": "<string>",
"password": "<string>",
"role": "<string>"
}Users
Get Current User Info
GET
/
users
/
me
Get Current User Info
curl --request GET \
--url https://api.example.com/users/me \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"id": 123,
"username": "<string>",
"email": "<string>",
"password": "<string>",
"role": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSotoSegovia/apiREST-userManagementSystem/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Retrieves the current authenticated user’s information by validating their email and password credentials.Authentication
This endpoint requires:- A valid JWT token in the Authorization header
- The user must have
ROLE_USERauthority - Valid email and password in the request body
Request
Headers
Authorization: Bearer <jwt_token>
Content-Type: application/json
Body Parameters
The email address of the user
The user’s password
Response
The unique identifier of the user
The username of the user
The email address of the user
The encrypted password of the user
The role assigned to the user (e.g., ROLE_USER, ROLE_ADMIN)
Example Request
curl -X GET http://localhost:8080/users/me \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"email": "usernormalsystem@ums.com",
"password": "NorUs1234"
}'
Example Response
{
"id": 2,
"username": "normal-user",
"email": "usernormalsystem@ums.com",
"password": "$2a$10$zAjODzgBZhCuL80b1OT51.jpYuOB8WmwqZ/u9ls4Xf7r0.7Vh9.jy",
"role": "ROLE_USER"
}
Error Responses
400 Bad Request
Returned when the request body validation fails.{
"message": "Error de validacion",
"statusCode": 400,
"errors": [
"Email is required",
"Password is required"
]
}
401 Unauthorized
Returned when:- No JWT token is provided
- The JWT token is invalid or expired
- The credentials (email/password) are incorrect
{
"error": "Unauthorized",
"message": "Authentication failed"
}
403 Forbidden
Returned when the user does not have the requiredROLE_USER authority.
{
"error": "Forbidden",
"message": "Access denied"
}
How to Get a JWT Token
Before calling this endpoint, you need to authenticate and obtain a JWT token:curl -X POST http://localhost:8080/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "usernormalsystem@ums.com",
"password": "NorUs1234"
}'
token field that you can use in the Authorization header.⌘I