Welcome to the Dataimpact API documentation!
This API provides access to various resources that allow you to retrieve, create, update, and delete data in a database.
Make sure you have docker installed on your machine, then clone the project and use :
$ docker compose up
Once the app is launched you can either use the api through postman or with the "requests" folder that contains some usecases.
This API provides the following endpoints:
GET http://localhost:8080/api/v1/users/ // retrive all users
GET http://localhost:8080/api/v1/users/{id} // retrive one user by id
POST http://localhost:8080/api/v1/users/{id} // seed the database users from a dataset
PATCH http://localhost:8080/api/v1/users/{id} // partially update a user
DELETE http://localhost:8080/api/v1/users/{id} // delete a user and its data
POST http://localhost:8080/api/v1/login // provides a JWT token to authenticate
Authetication request body:
{
"id": "your_user_id",
"password": "your_password"
}
To access this API, you need to authenticate yourself with a valid id and password. You can do this by sending a POST request to the /login endpoint with your credentials.
The API will then generate a JSON Web Token (JWT) that you need to include in the Authorization header of all subsequent requests.
To run the tests locally, you need to create a mongodb container :
$ make mongo
Then execute:
$ make test