The API server is reachable at https://assay-plate-server.fly.dev/
through HTTP requests with a JSON body. The server address may change after 2/29/2024.
API that has *
in the title expects an auth cookie in the request (obtained from login/signup API).
If the server receives an invalid auth cookie when it expects one, it sends back this JSON body:
{
"unauthorized": true
}
purpose: register new user account with username and password. Response includes an auth cookie.
request body:
{
"username": "",
"password": ""
}
response body (success):
{
"message": "",
"success": true
}
response body (failure):
{
"message": "",
}
purpose: log in with username and password. Response includes an auth cookie.
request body:
{
"username": "",
"password": ""
}
response body (success):
{
"message": "",
"success": true
}
response body (failure):
{
"message": "",
}
purpose: log out. Does not expect a request body. Response contains an expired cookie, prompting browsers to remove the auth cookie.
purpose: check if auth token is valid. Does not expect a request body.
response body:
{
"username": ""
}
purpose: delete user account. Does not expect a request body. Response contains an expired cookie, prompting browsers to remove the auth cookie.
See Plate Schema. Notable rules for valid data:
- length of
wells
must equal the product ofnRow
andnCol
- reagent must be a number prefixed with an "R" (e.g., "R123")
- concentration must be 0 without antibody
- concentration must be non-negative with antibody present
purpose: get all plates the user has, along with username (for frontend's convenience). Does not expect a request body.
response body:
{
"plates": [],
"username": ""
}
purpose: create new plates on the cloud. "output"
is an array with an object for each plate in the request.
request body:
{
"plates": []
}
response body:
{
"output": []
}
"output"
element (success):
{
"isCreated": true,
"newPlate": {}
}
"output"
element (failure):
{
"isCreated": false,
"reason": ""
}
purpose: read specified plates from the cloud. Expects an array of MongoDB _id
strings. "output"
is an array with an object for each plate in the request.
request body:
{
"IDs": []
}
response body:
{
"output": []
}
"output"
element (success):
{
"plate": {}
}
"output"
element (failure):
{
"_id": "",
"reason": ""
}
purpose: update specified plates on the cloud. "failures"
is an array that contains an element for each failed plate update only.
request body:
{
"plates": []
}
response body:
{
"failures": []
}
"failures"
element:
{
"_id": "",
"reason": ""
}
purpose: delete specified plates on the cloud. "failures"
is an array that contains an element for each failed plate update only.
request body:
{
"IDs": []
}
response body:
{
"failures": []
}
"failures"
element:
{
"_id": "",
"reason": ""
}