Versions Compared

Key

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

URL for test server: https://on-test.diaper.cf:5001

URL for prod server: https://on-prod.diaper.cf:5001

User Creation APIs

 

URL/api/users
DescriptionCreate a new user
MethodPUT
Url Param---
Request Body Data
{
email: xxx,
firstName: xxx,
lastName: xxx
}
Response
Response BodyCode

{

message: "Password set email has been sent."

}

200

{

message: "Malformatted JSON"

}

400

{

message: "There was a problem sending the password set email. Please try again later."

}

500

{

message: "User already exists!"

}

500
Cookie---

 

User Authentication APIs

...

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/<barcode_id>
DescriptionFetching a Specific Sample Response
HeaderAPI_KEY, Authorization
MethodGET
Url Param

barcode_id=[string]

Request Body Data

--

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

 

 

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

barcode_id=[string]

Request Body Data

--

Response

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

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

...