API Routes - TheBeetles/PolliNation GitHub Wiki
Creates a new account with the username and password and is sent through json.
Route: /api/register
Method Request: POST
{
"username": "[username]",
"password": "[password]"
}
Creates a session cookie and saves it on the users browser.
Route: /api/login
Method Request: POST
{
"username": "[username]",
"password": "[password]"
}
Verifies the user session cookies.
Route: /api/verify
Method Request: GET
Doesn't require any json data
Removes the session cookie from the users broswer.
Route: /api/logout
Method Request: GET
Doesn't require any json data
Changes the password of the user and logs out the user. This requires a fresh login.
Route: /api/change-password
Method Request: POST
{
"username": "[username]",
"password": "[password]"
}
Gets and saves the Image the user sent. The user must be logged in.
Route: /api/image/upload
Method Request: POST
Doesn't require any json.
Gets the image ID and responds with the image.
Route: /api/image/get/<image_id>
Method Request: GET
Doesn't require any json.
Sends all the ids of the images taken and saved.
Route: /api/image/get/all
Method Request: GET
Doesn't require Json.