Versions Compared

Key

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

...

URL/api/samples/
DescriptionFetching multiple Samples at the same time or Inserting a Sample.     [Poop Sample Response]
HeaderAPI_KEY, Authorization
MethodPUT | GET
Url Param

--

Request Body Data

PUT
{ sampleData: xxx, image: xxx}

Note: SampleData should send as form-data text, and the image should be form-data file.

Response

PUT

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, hasPict: xxx, hasSurvey: xxx, hasContainer: xxx
  • { 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, hasPictsurveyData: xxx, hasSurvey: xxx, hasContainer: xxx },
                              { id: xxx, dateTime: xxx, hasPict: xxx, hasSurvey: xxx, hasContainer: xxx },
                              {}…..{} ] }
    200: Success
    Note[Limit]: Up to 15 samples can be retrieved at max.
URL/api/samples/
DescriptionFetching multiple Samples at the same time or Inserting a Sample.     [Poop Sample Response]
HeaderAPI_KEY, Authorization
MethodPUT | GET
Url Param

--

Request Body Data

PUT
{ sampleData: xxx, image: xxx}

Note: SampleData should send as form-data text, and the image should be form-data file.

  • [xx, xx], image: img, email: xxx},
                           
 
  •   { id: xxx, dateTime: xxx,
hasPict
  • surveyData:
xxx, hasSurvey: xxx, hasContainer: xxx },
                          {}…..{} ] }
200: Success
Note[Limit]: Up to 15 samples can be retrieved at max.
URL/api/samples/
DescriptionFetching multiple Samples at the same time or Inserting a Sample.     [Poop Sample Response]
HeaderAPI_KEY, Authorization
MethodPUT | GET
Url Param

--

Request Body Data

PUT
{ sampleData: xxx, 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" } - 404
  • { message: "Bad request: no sample data"} - 404
  • { message: "Bad request: no barcode ID"} - 404
  • { message: "Bad request: no survey data"} - 404
GET
{ sampleList: [ { id: xxx, dateTime: xxx, hasPict: xxx, hasSurvey: xxx, hasContainer
  • [xx, xx], image: img, email: xxx},
                              {
id: xxx, dateTime: xxx, hasPict: xxx, hasSurvey: xxx, hasContainer: xxx
  • }
,
                          {}
  • …..{} ] }
    200: Success
Note[Limit]: Up to 15 samples can be retrieved at max.


URL/api/sample/<sample_id>
DescriptionFetching the image of a Specific Sample Response
HeaderAPI_KEY, Authorization
MethodGET
Url Param

sample_id=[string]

Request Body Data

PUT
{ sampleData: xxx, image: xxx}

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 } }
200: Success

{ message: ”This user does not have access to this sample data” }
403: Unauthorized

{ message: ”No such sample exists” }
404: Resource Not Found

{ message: ”This user does not have access to this sample data” }
403: Unauthorized

{ message: ”No such sample exists” }
404: Resource Not Found

...

URL/api/sample/count_this_week
DescriptionReturn the total number the user uploaded this week
HeaderAPI_KEY, Authorization
MethodGET
Url Param
Request Body Data

--

Response

{ "sampleCount": int } - 200



URL/api/sample/<sample_id>/updatesurvey 
DescriptionUpdate survey for the given sample id
HeaderAPI_KEY, Authorization
MethodGET
Url Param


Request Body Data

sample_id: ID for the sample to update

surveyData: list of new survey data

Response

{message: "Bad request: no survey data to update"} - 404

{message: "sample id is invalid"} - 400

{message: "successfully updated survey data"} - 200





URL/api/sample/count_total
DescriptionReturn the total number the user uploaded
HeaderAPI_KEY, Authorization
MethodGET
Url Param--
Request Body Data

--

Response

{ "sampleCount": int } - 200

...