...
| 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 | barcode_id=[string] |
| Request Body Data | -- |
| Response | { sample: { id: xxx, dateTime: xxx, hasPict: xxx, hasSurvey: xxx, hasContainer: xxx } } |
...
| URL | /api/sample/<barcode_id>/image |
| Description | Fetching the image of a Specific Sample Response |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | barcode_id=[string] |
| Request Body Data | -- |
| Response | { message: ”This user does not have access to this sample data” } |
| URL | /api/sample/count_this_week |
| Description | Return the total number the user uploaded this week |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | |
| Request Body Data | -- |
| Response | { "sampleCount": int } - 200 |
| URL | /api/sample/count_total |
| Description | Return the total number the user uploaded |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | -- |
| Request Body Data | -- |
| Response | { "sampleCount": int } - 200 |
Survey APIs
| URL | /api/survey/questions | ||
| Description | Returns the sample survey when 'main_survey' is passed in as survey_name | ||
| Header | API_KEY, Authorization | ||
| Method | GET | ||
| Url Param | survey_name | ||
| Request Body Data | -- | ||
| Response |
|
| URL | /api/survey |
| Description | Place a survey into the database in order to be retrieved by the application in the future |
| Header | API_KEY, Authorization |
| Method | PUT |
| Url Param | survey_name |
| Request Body Data | Survey to placed in the database |
| Response | { "message": "Incorrect API key provided." } { "message": "Survey stored!" }, 200 If survey name not passed in, { "message"="Please pass in survey name to create a survey" }, 400 |
| URL | /api/survey/question/<question_id>/responses |
| Description | Return the responses to a question given the question id and survey name are passed in |
| Header | API_KEY, Authorization |
| Method | GET |
| Url Param | survey_name |
| Request Body Data | -- |
| Response | {responseList: []}, 200
When an incorrect question ID is passed in: { "message": "Question ID is not found!" }, 400 |