Get User by ID
Retrieves a single user by their ID.
The unique identifier of the user
Response
User’s paternal last name
User’s maternal last name
User’s username for authentication
User’s profile photo filename
User registration date (format: yyyy-MM-dd)
User’s national identification number
User status (“Activo” or “No Activo”)
Role ID (1 = ADMIN, 2 = USER)
User’s role information
Role type (ADMIN or USER)
curl -X GET "https://api.investgo.com/api/buscar/1" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"id": 1,
"nombre": "Juan",
"apellidoPa": "Pérez",
"apellidoMa": "García",
"telefono": "987654321",
"correo": "[email protected]",
"username": "juanperez",
"foto": "default.png",
"fecha": "2024-01-15",
"dni": "12345678",
"enable": "Activo",
"idTipoUsu": 2,
"tiporol": {
"idTipoUsu": 2,
"tipo": "USER"
}
}
Get User by Username
Retrieves a user by their username.
The username to search for
curl -X GET "https://api.investgo.com/api/juanperez" \
-H "Authorization: Bearer YOUR_TOKEN"
List Active Users
GET /api/active/listaUsuario
Retrieves all active users (excludes “No Activo” users).
curl -X GET "https://api.investgo.com/api/active/listaUsuario" \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"id": 1,
"nombre": "Juan",
"apellidoPa": "Pérez",
"apellidoMa": "García",
"correo": "[email protected]",
"username": "juanperez",
"enable": "Activo",
"idTipoUsu": 2
}
]
List All Users
Retrieves all users in the system.
curl -X GET "https://api.investgo.com/api/listarusuarios" \
-H "Authorization: Bearer YOUR_TOKEN"
List Roles
Retrieves all available user roles.
curl -X GET "https://api.investgo.com/api/listarRoles" \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"idTipoUsu": 1,
"tipo": "ADMIN"
},
{
"idTipoUsu": 2,
"tipo": "USER"
}
]
Register User
Creates a new user account.
- Username, email, and DNI must be unique
- Password will be encrypted automatically
- User photo defaults to “default.png”
- A wallet (cartera) is automatically created with 0 balance
- Cannot register with ADMIN role
Request Body
User’s paternal last name
User’s maternal last name
User’s password (will be encrypted)
User’s national identification number
curl -X POST "https://api.investgo.com/api/registrar" \
-H "Content-Type: application/json" \
-d '{
"nombre": "Juan",
"apellidoPa": "Pérez",
"apellidoMa": "García",
"telefono": "987654321",
"correo": "[email protected]",
"username": "juanperez",
"password": "securePassword123",
"dni": "12345678",
"idTipoUsu": 2
}'
{
"mensaje": "Has sido registrado exitosamente",
"empleado": {
"id": 5,
"nombre": "Juan",
"apellidoPa": "Pérez",
"apellidoMa": "García",
"telefono": "987654321",
"correo": "[email protected]",
"username": "juanperez",
"foto": "default.png",
"fecha": "2024-03-15",
"dni": "12345678",
"enable": "Activo",
"idTipoUsu": 2
},
"cartera": {
"idCartera": 5,
"saldo": 0,
"idUsu": 5
}
}
Update User
Updates an existing user’s information.
- Cannot update username, password, role (idTipoUsu), or registration date
- Can only update: name, phone, email, and DNI
- Email and DNI must remain unique
Request Body
Updated paternal last name
Updated maternal last name
Updated email (must be unique)
Updated DNI (must be unique)
curl -X PUT "https://api.investgo.com/api/actualizar" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"id": 5,
"nombre": "Juan Carlos",
"apellidoPa": "Pérez",
"apellidoMa": "García",
"telefono": "987654322",
"correo": "[email protected]",
"dni": "12345678"
}'
{
"mensaje": "Usuario actualizado exitosamente"
}
Delete User (Soft Delete)
DELETE /api/eliminar/{id}
Soft deletes a user by setting their status to “No Activo”.
This is a soft delete - the user record is not removed from the database, only marked as inactive.
The ID of the user to delete
curl -X DELETE "https://api.investgo.com/api/eliminar/5" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"mensaje": "Se elimino exitosamente el usuario"
}