Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

URL/api/samples/
Description

GET: Fetching all samples created from a user

PUT: Inserting a new sample [Poop Sample Response]

HeaderAPI_KEY, Authorization
Content-typemultipart/form-data
MethodPUT | 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

  • { message: “Sample data recorded!” } - 200: Success
  • { message: "Bad request: no image or sample data" } - 400
  • { message: "Bad request: no sample data"} - 401
  • { message: "Bad request: no barcode ID"} - 402
  • { message: "Bad request: no survey data"} - 403


GET
{ sampleList: [ { id: xxx, dateTime: xxx, surveyData: [xx, xx], image: img, email: xxx},
                          { id: xxx, dateTime: xxx, surveyData: [xx, xx], image: img, email: xxx},
                          {}…..{} ] }
200: Success

...