AutoSuggestion Quiz API (0.1.0)

Download OpenAPI specification:

Backend API for the AutoSuggestion Quiz application.

auth

Register

Register a new user.

  • name: Full name of the user
  • email: Must be unique
  • password: Will be hashed before storage
  • role: Must be one of student, teacher, admin
Request Body schema: application/json
required
name
required
string (Name)
email
required
string (Email)
password
required
string (Password)
role
string (Role)
Default: "student"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "password": "string",
  • "role": "student"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Login

Authenticate a user and return a JWT token.

  • email: Registered email address
  • password: Plain text password to verify against stored hash
Request Body schema: application/json
required
email
required
string (Email)
password
required
string (Password)

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Root

Health check endpoint.

:return: A JSON object confirming the API is running.

Responses

Response samples

Content type
application/json
null