Managing employee profiles can be a complex task that requires a streamlined and efficient system. With this REST API, we aim to simplify the process of managing employee profiles by providing a comprehensive and user-friendly solution.
This REST API offers the following features:
- Create, read, update, and delete employee profiles
- Retrieve a list of all employee profiles or search for specific profiles based on criteria such as name, department, or job title
- Store employee profiles in a database for easy retrieval and management
- Validate and sanitize input data to ensure data integrity and consistency
- Authenticate and authorize users with appropriate access levels
This project was built using the following technologies:
- Python
- Flask
- Flask-RESTful
- Flask-Marshmallow
- Flask-SQLAlchemy
- SQLite (or your preferred database management system)
make build
In your browser (assuming the docker-machine runs on 192.168.99.100) go to:
http://192.168.99.100
To clean up the container mess, run
make clean
It will shut down all container and remove all images
{
"name" : "Name of the profile",
"birthdate": "Birthdate of the profile",
"status": "ACTIVE/PAUSED"
}
- Default status is set tobe "ACTIVE".
- Birthdate should be in format "YYYY-MM-DD"
- Profile id is autoincremented.
GET
"/"
Gets API version and information about endpoints and methods.
GET
"/doc"
Renders README page into html.
GET
"/profile"
Fetch all the existing profile in the database
Response
Type JSON
{
"created_at": "timestamp",
"data": [
{
"name": "name",
"id": 1,
"birthdate": "1978-06-20",
"status": "ACTIVE"
},
],
"total": 1
}
POST
"/profile"
Create a new profile
Body
Type JSON
{
"name": "name",
"birthdate": "1978-06-20",
"status": "ACTIVE"
}
Response
Type JSON
GET
"/profile/active"
Gets all the profile with status "ACTIVE"
Response
Type JSON
GET
"/profile/paused"
Gets all the profile with status "PAUSED"
Response
Type JSON
GET
"/profile/{id}"
Fetch profile with given id.
Response
Type JSON
PATCH
"/profile/{id}"
Update profile with given id.
Body
Type JSON
{
"name": "name",
"birthdate": "1978-06-20",
"status": "ACTIVE"
}
Send only field needed to updated.
Response
Type JSON
DELETE
"/profile/{id}"
Deletes the profile with given id.
Response
Type JSON
For detailed information on how to use each endpoint, refer to the API documentation or the Swagger UI (available at /swagger
) when running the API locally.
We welcome contributions from the community. If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Push your changes to your fork.
- Submit a pull request.