...
| 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 |
|
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)
- HTML Form Submission with fields:
- email (string)
- password (string)
- remember_me (optional boolean)
- Alternatively, you can manually add following fields in request body as a json format:
- email (string)
- password (string)
- remember_me (optional boolean)
- formdata (empty string)
- {message: "Logged in."} - 200
- {message: "Bad request format"} - 400
- {message: "invalid credential(s) provided, please check your credential(s) and try again"} - 400/401
- session: a cookie for trace login status
- remember_token: a cookie for remember_me feature (only when logged in with remember_me set to true)
- {message: "Password reset email has been sent."} - 200
- {message: "There was a problem sending the password reset email. Please try again later"} - 500
A json format data
{
"password": "<string-password>"
}
- {message: "Successfully updated password."} - 200
- {message: "Unauthorized: you do not have access to reset this user's password"} - 401
- HTML Form Submission with fields:
- email (string)
- username (string)
- password (string)
- password2 (string)
- Alternatively, you can manually add following fields in request body as a json format:
- email (string)
- username (string)
- password (string)
- password2 (string)
- formdata (!EMPTY! string)
- {message: "Registered, please login."} - 200
- {message: "Data input is not valid, please try again"} - 400
- {message: "logged out"} - 200
- session: will be removed
- remember_token: will be removed
A json format data
{
"sample": {
"description": "test",
"image_url": "url",
"uploader": "uploader",
"sample_id": "0000",
"sample_type": "BS",
"infant_id": "00"
}
}
- {message: "Sample data recorded!"} - 200
- {message: "Bad reques"} - 400
- {message: "invalid credential(s) provided, please check your credential(s) and try again"} - 400/401
- {message: "Internal Error, please try again"} - 500
- {message: "Bad barcode id"} -400
- {message: "Bad Request"} - 400
- {message: "No image data found for barcode {barcode_id}"} - 404
- {message: "No sample found for barcode {barcode_id}"} - 404
- image - 200
files: {
image: image
}
- {message: "Bad barcode id"} -400
- {message: "Bad Request"} - 400
- {message: "No sample found for barcode {barcode_id}"} - 404
- {message: "No image uploaded, bad request"} - 400
- {message: "image saved"} - 200
{
data: survey
}
- {message: "Bad barcode id"} -400
- {message: "Bad Request"} - 400
- {message: "No sample found for barcode {barcode_id}"} - 404
- {message: "No survey found in request body"} - 400
- {message: "survey saved"} - 200
- {message: "Bad barcode id"} -400
- {message: "Bad Request"} - 400
- {message: "No sample found for barcode {barcode_id}"} - 404
- {message: "No survey found for barcode {barcode_id}"} - 404
- survey_data - 200
- description (string)
- infant_id (string)
- name (string)
{message: "Infant created"} -200
{message: "Internal Error, please try again"} - 500
{message: "Data input is not valid, please try again"} - 400
- {message: "Infant does not exist"} -404
{
'infant_id': infant.infant_id,
'name': infant.name,
'create_time': infant.create_time,
'description': infant.description
}, 200
Get Survey CSV data by surveyId
surveyId= SV_8ILsEKzfiTLFmAK retrieves "Infant Nutrition After Birth Survey.csv"
surveyId=SV_2hHGHXngHMfsIyF retrieves "Infant Nutrition Onboarding.csv"
- {statusCode: 200, data: {"csv data..."}} , 200
| URL | /api/sendOnboardingSurvey |
| Description | Post to this endpoint with <email> and (optional) <name> to send onboarding email to email |
| Method | POST |
| Url Param | |
| Request Body Data | form-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 |
...