This project was developed using the following technologies:
- Python 3.9
- Pip library
$ git clone https://github.com/Kenzie-Academy-Brasil-Developers/q3-sprint6-autenticacao-e-autorizacao-lsmescolotto
$ cd q3-sprint6-autenticacao-e-autorizacao-lsmescolotto
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ flask run
-
Use an API request sending platform like Insomnia
https://vaccination-lsmescolotto.herokuapp.com/vaccinations
This API has 2(two) endpoints to: add a new vaccination card and to get all of the cards.
POST - REQUEST FORMAT
{
"cpf": "01234567898",
"name": "Pandora",
"vaccine_name": "jansen",
"health_unit_name": "COloninha"
}
If the request is corret, the vaccination card will be added:
POST - RESPONSE FORMAT - STATUS 201
{
"cpf": "01234567898",
"first_shot_date": "Tue, 12 Apr 2022 14:19:46 GMT",
"health_unit_name": "Coloninha",
"name": "Pandora",
"second_shot_date": "Mon, 11 Jul 2022 14:13:24 GMT",
"vaccine_name": "Jansen"
}
If extra keys are sent:
POST - RESPONSE FORMAT - STATUS 201
{
"cpf": "01234567898",
"first_shot_date": "Tue, 12 Apr 2022 14:19:46 GMT",
"health_unit_name": "Coloninha",
"name": "Pandora",
"second_shot_date": "Mon, 11 Jul 2022 14:13:24 GMT",
"vaccine_name": "Jansen"
}
If the cpf has more than 11 characters:
STATUS 400
{
"error": "cpf value too long"
}
If at least one of the inserted values is not a string:
STATUS 400
{
"error": "one or more of the inserted values are not strings"
}
If at least one of the keys is missing:
STATUS 400
{
"expected_keys": ["vaccine_name", "name", "health_unit_name", "cpf"],
"invalid_sent_keys": []
}
GET - REQUEST FORMAT
No Body
GET - RESPONSE FORMAT - STATUS 200
[
{
"cpf": "01234567898",
"first_shot_date": "Fri, 29 Apr 2022 20:12:42 GMT",
"health_unit_name": "Coloninha",
"name": "Pandora",
"second_shot_date": "Thu, 28 Jul 2022 20:12:42 GMT",
"vaccine_name": "Jansen"
},
{
"cpf": "01234567893",
"first_shot_date": "Fri, 29 Apr 2022 20:12:42 GMT",
"health_unit_name": "Coloninha",
"name": "Pandora",
"second_shot_date": "Thu, 28 Jul 2022 20:12:42 GMT",
"vaccine_name": "Jansen"
}
]
Developed by Luiza Schmidt Mescolotto