/ping
GET
Returns the string 'pong' if successful.
/users
GET
Returns a JSON of an array containing all usernames and emails.
/register
POST
Enters user data into the Postgres database and sends verification email to user.
Receives a multipart/form-data with the following fields:
-- fname
string
-- lname
string
-- email
string
-- username
string
-- password
string
/verify
POST
Marks user as 'verified' in the database. Returns a JSON of the user object or an
AuthError
(see below).
Receives a multipart/form-data with the following fields:
-- verification_code
string
Possible AuthError
status codes:
-- 201
- user is verified
-- 202
- user input is not a number
-- 203
- credentials are wrong
-- 204
- unknown error
/login
POST
Checks if user has the correct credentials. If they are correct, a JSON of the user object is returned, otherwise an
AuthError
is sent (see below).
Receives a multipart/form-data with the following fields:
-- username
string
-- password
string
NOTE: username
accepts either user's email or username.
Possible AuthError
status codes:
-- 201
- user credentials are correct
-- 202
- user input is not a number
-- 203
- credentials are wrong
-- 204
- unknown error
/image
POST
Decodes
image
, analyzes it and sends an instruction string back.
Receives a multipart/form-data with the following fields:
-- name
string
-- image
string
NOTE: image
must be base 64 encoded.
Possible instructions that can be returned:
-- FORWARD
-- RIGHT
-- LEFT
-- STOP