URL for test server: https://mobile-test.diaper-project.
cfcom:5001
URL for prod server: https://mobile-prod.diaper-project.
cfcom:5001Note:
Notes:
The API key is jus the API key.
...
| URL | /api/users | ||||||||||
| Description | Create a new user | ||||||||||
| Method | PUT | ||||||||||
| Content-type | application/json | ||||||||||
| Url Param | --- | ||||||||||
| Request Body Data | { email: xxx, firstName: xxx, lastName: xxx, surveyData: xxx } | ||||||||||
| Response |
| ||||||||||
| Cookie | --- |
User Authentication APIs
...
| URL | /api/auth | ||||||||||
| Description | User login | ||||||||||
| Method | POST | ||||||||||
| Content-type | application/json | ||||||||||
| Url Param | -- | ||||||||||
| Request Body Data | { email: xxx, password: xxx, firstName: xxx, lastName: xxx } | ||||||||||
| Response |
| ||||||||||
| Cookie | --- |
| URL | /api/users/<email>/resetpassword | ||||||||
| Description | Reset password with given new password | ||||||||
| Method | POST | ||||||||
| Url Param | email: email for the user to reset password | ||||||||
| Request Body Data | { password: xxx } Note: password field takes the new password to be reset, not the old password. | ||||||||
| Response |
| ||||||||
| Cookie | --- |
| URL | /api/users/<email>/requestpasswordreset | ||||||||
| Description | Send password reset email | ||||||||
| Method | POST | ||||||||
| Url Param | email: email for the user to reset password | ||||||||
| Request Body Data | --- | ||||||||
| Response |
| ||||||||
| Cookie | --- |
| URL | /api/logout | ||||
| Description | Log out user by deleting the user's access token | ||||
| Method | DELETE | ||||
| Url Param | --- | ||||
| Request Body Data | --- | ||||
| Response |
| ||||
| Cookie | --- |
Sample APIs
| URL | /api/samples/ |
| Description | GET: Fetching all samples created from a user PUT: Inserting a new sample [Poop Sample Response] |
| Header | API_KEY, Authorization |
| Content-type | multipart/form-data |
| Method | PUT | GET |
| Url Param | -- |
| Request Body Data | GET --- PUT sampleData: { sampleBarcodeID: xxx, milkBarcodeID:xxx, surveyData: {...} }, image: xxx } Note: SampleData should send as form-data text, and the image should be form-data file. |
| Response | PUT
{ id: barcode id, milk_id: milk id, dateTime: timestamp, surveyData: {}, readableSurveyData: {}, image_url: url of sample image, email: xxx@gmail.com }, { ... },] } |
...