dotnet verion : 9.0.101
Hello Friend!
This API provides endpoints for managing users in the system. It allows for creating, reading, updating, and deleting user records. Each user has a set of attributes such as NomeCompleto (Full Name), Email, Cargo (Position), Salario (Salary), CPF (Brazilian Identification Number), and Situacao (Status). The API is designed to be simple and intuitive, supporting the basic CRUD (Create, Read, Update, Delete) operations.
Base URL
The base URL for the API is: http://localhost:5162/api/usuario/
- POST /create: Adds a new user to the system.
- GET /readAll: Retrieves all users from the database.
- PUT /update: Updates the details of an existing user.
- DELETE /delete: Deletes a user from the system.
- GET /findById: Fetches a user by their ID.
Each endpoint requires specific parameters in the request body (for POST, PUT, and DELETE), or query parameters (for GET), and returns relevant data or a success/failure status.
This documentation provides a detailed description of each endpoint, including request examples and expected responses. You can use it to interact with your API via tools like Postman or any HTTP client.
http://localhost:5162/api/usuario/createCreates a new user in the database. This endpoint requires the new user's details to be provided in the request body. Upon creation, a new user will be added, and a success status will be returned.
{
"NomeCompleto" : "Ramadan 6",
"Email" : "ramadan6@gmail.com",
"Cargo" : "FullStack6",
"Salario" : 9996.0,
"CPF" : "1233ds326",
"Situacao" : true,
"Senha" : "1234566"
}
http://localhost:5162/api/usuario/readAllFetches all the users registered in the database. This endpoint returns a list of all users, including information like name, email, position, salary, etc.
http://localhost:5162/api/usuario/updateUpdates the details of an existing user based on the provided ID. This endpoint allows you to modify information such as name, email, position, salary, etc. The new user details should be sent in the request body along with the user's ID.
{
"id": 6,
"nomeCompleto": "Ramadan 16",
"email": "ramadan16@gmail.com",
"cargo": "FullStack6",
"salario": 9996,
"situacao": false
}
http://localhost:5162/api/usuario/deleteDeletes an existing user from the database based on the provided ID. This endpoint requires the user's ID to be sent in the request body.
{
"id" : 4
}
http://localhost:5162/api/usuario/findByIdFetches a specific user by the provided ID. This endpoint returns the full details of the user corresponding to the given ID.
{
"id" : 3
}