-
Notifications
You must be signed in to change notification settings - Fork 23
API
Ashutosh Sahu edited this page Jun 16, 2021
·
1 revision
Welcome to the Health Predictor API wiki here you can find all API calls and how they work.
base url = https://nutrihelpb.herokuapp.com
You can access the database sample using
https://nutrihelpb.herokuapp.com/col/test for any testing references.
The login process is available at API https://nutrihelpb.herokuapp.com with endpoint /login.
This endpoint works for all POST requests having payload format -
{
"email" : "string", //required
"otp" : "string" //optional
}- if only the email field is provided, a user gets created (if not exists) and an OTP is mailed to that user.
- again requesting the same endpoint with the above format, will match the top, and gives a response.
- When a patient logins, an
useridwill be sent to the response. - this
useridwill be used for all requests and further API calls. - save It in shared preferences for use.
{
"age" : 33, # integer
"gender" : "M", # valid types ["M", "F"]
"id" : { "$oid": "60978a1146ec034af162591d" }, #MongoDB ObjectId instance.
"mobile" : "9109087293", # string
"name" : "Amit Sharma", # string
"stats" : {
"family_diabetes" : (true, false), # bool
"bp" : 223, # (unit : mmHg) integer
"physically_active" : ("no","low","mid","high"), # any one string
"weight" : 78, # (unit : kg) integer
"height" : 5.6, # (unit : inch) integer
"smoke" : (true, false), # bool
"alcolol" : (true, false), # bool
"sleep" : 8, # (unit: hours, range = (4,11)) integer
"sound_sleep" : (true,false), # bool
"medicine" : (true,false), # bool;
"junk_food" : ("no","low","mid","high"), # any one string
"stress" : ("no","low","mid","high"), # any one string
"pregnancies" : 0, # integer
"gestational" : (true,false), # bool
"urination" : ("normal","high") # any one string
}
}- adds a patient to the given user's patient list. request format:
{
"userid": "60978a1146ec034af162591d", # string
"patient": {
# as given in above schema.
# don't provide fields => id
# required => age, gender, mobile, name
# stats are optional, but still providing them with default values will reduce chances of error.
}
}- gives a list of all patients who belong to a given userid
- return only name, age, gender, mobile of patient
- gives the whole details of a single patient.
- modifies a single patient with the provided fields.
- provide only those fields which need to be modified. request payload example:
{
"age" : 24,
"mobile" : "91090873343",
"name" : "Amit Verma",
"stats" : {
"family_diabetes" : true,
"physically_active" : "mid"
}- deletes a patient from the user who matches the given patient id.
- generate and return diabetes report of a patient.
- the response contains
id,typeof report,probabilityof disease,patient_nameandpatient_id
- gives a list of all reports generated by a given user
- gives recently generated reports
- returns a specific report.
- deletes the specified report
- return a random health tip.