The test server ip-address:port is https://dashboard-test.diaper-project.com:5000
The production server ip-address:port is https://dashboard-prod.diaper-project.com:5000
The production server AWS Chalice:port is https://4wuiajclt6.execute-api.us-east-1.amazonaws.com/api/ (Used for demographic tabs on the website)
| URL | /api/login/ |
| Description | Login a user, and set cookie for authentication |
| Method | POST |
| Url Param | |
| Request Body Data |
|
| Response |
|
| Cookie |
|
| URL | /api/users/<email>/request-password-reset/ |
| Description | Request an email with a link and access token to reset password |
| Method | POST |
| Url Param | |
| Request Body Data | |
| Response |
|
| Cookie |
| URL | /api/users/<email>/resetpassword/ |
| Description | Request an email with a link and access token to reset password |
| Method | POST |
| Url Param | |
| Request Body Data | A json format data |
| Response |
|
| Cookie |
| URL | /api/registration/ |
| Description | Register a new user. |
| Method | POST |
| Url Param | |
| Request Body Data |
|
| Response |
|
| Cookie |
| URL | /api/logout/ |
| Description | Logout a user, set cookie/disable the token saved in cookie |
| Method | POST |
| Url Param | |
| Request Body Data | |
| Response |
|
| Cookie |
|
| URL | /api/samples/ |
| Description | Add sample data to mongoDB |
| Method | POST |
| Url Param | |
| Request Body Data | A json format data |
| Response |
|
| URL | /api/mobile-samples/ |
| Description | Get user's sample data from mobile database |
| Method | GET |
| Url Param | |
| Response |
|
| URL | /api/mobile-samples/image/<barcode_id> |
| Description | Get sample image to mongoDB |
| Method | GET |
| Url Param | barcode_id |
| Request Body Data | |
| Response |
|
| URL | /api/samples/image/<barcode_id> |
| Description | Add sample image to mongoDB |
| Method | POST |
| Url Param | barcode_id |
| Request Body Data | files: { image: image } |
| Response |
|
| URL | /api/samples/surey/<barcode_id> |
| Description | Get sample image to mongoDB |
| Method | GET |
| Url Param | barcode_id |
| Request Body Data | { data: survey } |
| Response |
|
| URL | /api/samples/surey/<barcode_id> |
| Description | Add sample image to mongoDB |
| Method | POST |
| Url Param | barcode_id |
| Request Body Data | |
| Response |
|
| URL | /api/infant/ |
| Description | Add infant to db |
| Method | POST |
| Url Param | |
| Request Body Data | HTML Form Submission with fields:
|
| Response |
|
| URL | /api/infant/<id> |
| Description | Get infant by id |
| Method | GET |
| Url Param | infant_id |
| Request Body Data | |
| Response |
|
| URL | /api/getSurvey/<surveyId> |
| Description | Get Survey CSV data by surveyId surveyId= SV_8ILsEKzfiTLFmAK retrieves "Infant Nutrition After Birth Survey.csv" surveyId=SV_2hHGHXngHMfsIyF retrieves "Infant Nutrition Onboarding.csv" |
| Method | GET |
| Url Param | surveyId |
| Request Body Data | |
| Response |
|
| URL | /api/upload/ |
| Description | GET: Fetching all uploaded species reads PUT: Upload a species read |
| Header | API_KEY |
| Method | PUT | GET |
| Url Param | -- |
| Request Body Data | GET --- PUT { "email":"XXXXX", "barcode_id":"XXXXX", ... |
| "Response | PUT
{ ... ... 200: Success |
| URL | /api/stool-color/ |
| Description | GET: Fetching all barcodes with their associated color |
| Method | GET |
| Request Body Data | |
| Response | {
"colors": [
{
"barcode_id": "XXXXX",
"color": "XXXXX"
},
{
"barcode_id": "XXX",
"color": "XXX"
}, |
| URL | /api/stool-barcodes/ |
| Description | GET: Fetch all valid barcodes in MongoDB |
| Method | GET |
| Request Body Data | |
| Response | {
"barcode_id": [
"XXX1",
"XXX2",
"XXX3", |
| URL | /api/stool-picture/<barcode_id> |
| Description | GET: Fetch an image for the given barcode_id Valid barcode_ids can be fetched using /api/stool-barcodes/ |
| Method | GET |
| Url Param | barcode_id |
| Response | if <barcode_id> is valid: |