User Authentication APIs
| URL | /api/version |
| Description | Show API Version |
| Method | GET |
| Url Param | -- |
| Request Body Data | -- |
| Response | {version: "xxx"} - 200 |
| Cookie | -- |
| URL | /api/auth |
| Description | User login |
| Method | POST |
| Url Param | -- |
| Request Body Data | |
| Response |
|
| Cookie |
|
Sample APIs
| URL | /api/samples/ |
| Description | Fetching multiple Samples at the same time or Inserting a Sample. [Poop Sample Response] |
| Header | API_KEY, Authorization |
| Method | PUT | GET |
| Url Param | -- |
| Request Body Data |
- {message: "Registered, please login."} - 200
- {message: "Data input is not valid, please try again"} - 400
PUT Note: SampleData should send as form-data text, and the image should be form-data file. | |
| Response | PUT
|
| URL | /api/samples/ |
| Description | Fetching multiple Samples at the same time or Inserting a Sample. [Poop Sample Response] |
| Header | API_KEY, Authorization |
| Method | PUT | GET |
| Url Param | -- |
| Request Body Data | PUT Note: SampleData should send as form-data text, and the image should be form-data file. |
| Response | PUT
GET |
{ email: xxx, password: xxx}
authToken: xxx,
email: xxx,
firstName: xxx,
lastName: xxx }
201: Created
{ message: ”Failed Login”}
| URL | /api/samples/ | |||
| Description | Add sample data to mongoDB | Fetching multiple Samples at the same time or Inserting a Sample. [Poop Sample Response] | ||
| Header | API_KEY, Authorization | |||
| Method | PUT | GET | Method | POST | |
| Url Param | -- | |||
| Request Body Data | A json format data { "sample": { "description": "test", "image_url": "url", "uploader": "uploader", "sample_id": "0000", "sample_type": "BS", "infant_id": "00" } } | Response | PUT Note: SampleData should send as form-data text, and the image should be form-data file. | |
| Response | PUT
GET |
| URL | /api/sample/<sample_id> |
| Description | Fetching the image of a Specific Sample Response |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | sample_id=[string] |
| Request Body Data | PUT Note: SampleData should send as form-data text, and the image should be form-data file. |
| Response | { sample: { id: xxx, dateTime: xxx, hasPict: xxx, hasSurvey: xxx, hasContainer: xxx } } { message: ”This user does not have access to this sample data” } |
| URL | /api/sample/<barcode_id> |
| Description | Fetching a Specific Sample Response |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | sample_id=[string] |
| Request Body Data | PUT Note: SampleData should send as form-data text, and the image should be form-data file. |
| Response | { sample: { id: xxx, dateTime: xxx, hasPict: xxx, hasSurvey: xxx, hasContainer: xxx } } |
| URL | /api/sample/<barcode_id> |
| Description | Fetching the image of a Specific Sample Response |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | sample_id=[string] |
| Request Body Data | PUT Note: SampleData should send as form-data text, and the image should be form-data file. |
| Response | { message: ”This user does not have access to this sample data” } |