Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update Sample Field

...

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,

id: barcode id,

milk_id: milk id,

dateTime: timestamp,

surveyData: [xx, xx],

image_url: url of sample image,

email: xxx@gmail.com

},

{

...

},]

: img, email: xxx},
                          {}…..{} ] }
200: Success


URL/api/sample/<sample_id>(deprecated)
DescriptionFetching the image of a Specific Sample Response

...