NonaLifestyle Assessment
Link to the API:
http://teut.pythonanywhere.com/
Methods :
GET - Get all survivors
2) http://teut.pythonanywhere.com/survivors/<survivor_id>
Methods :
GET - Get a survivor by id
POST - Create new survivor
PUT - Update details of survivor
POST/PUT body example:
{
"name": "Kevin Dickerson",
"age": 14,
"gender": "M",
"lat": -50.677346,
"lon": -169.916907,
"contamination": 3
}
3) http://teut.pythonanywhere.com/survivors/<survivor_id>/increase-contamination
Methods :
GET - Update survivor contamination reporting
Methods :
GET - Get report with the following data:
a) Percentage of infected survivors.
b) Percentage of non-infected survivors.
c) Average amount of each kind of resource by survivor (e.g. 5 waters per survivor)
d) Points lost because of infected survivors.
5) http://teut.pythonanywhere.com/trades/<survivor_id>/
Methods :
GET - Get inventory of survivor by id
Methods :
POST - Perform trading
POST/PUT body format and example:
{
<survivor1_id>: {
<resource_name> : <quantity>,
...
},
<survivor2_id>: {
<resource_name> : <quantity>,
...
},
}
{
"61c1d406-7a3d-4a2e-9573-064de5fd8c48": {
"Water" : 2,
"Ammunition" : 3
},
"9ae5a5d7-32c5-4ea1-a10e-14d3e0c08951": {
"Water" : 2,
"Medication" : 3
},
}