Skip to main content

API 1 - CLAAC

CLAAC - OpenAPI 3.0 (1.0.11)

Download OpenAPI specification:Download

This is the OpenAPI 3.0 documentation for CLAAC. This will include information on login, register, and other aspects that our profect uses.

login

Handles getting access to an already established account.

Login to an administrator account

Access the account of a administrator

Request Body schema: application/json

Access the account of a administrator

email
required
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "email": "bob@gmail.com",
  • "password": "12345B"
}

Response samples

Content type
application/json
{
  • "message": "Login successful",
  • "role": "admin",
  • "token": "c6fke676-676t-6767-67i6-67676",
  • "user_id": 67
}

users

Access to user information and features.

Get the interest of a student within their profile.

Return a list of strings

path Parameters
userId
required
integer

The account number of the child account.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "user_id": 67,
  • "preferred_words": [
    ],
  • "interests": [
    ]
}

profile

information about current user

Finds the data in a profile.

Responses

Response samples

Content type
application/json
{
  • "email": "johndoe@gmail.com",
  • "id": 67,
  • "role": "admin",
  • "username": "John Doe"
}

children

data about the children under an administrators account

Find the children associated with an Admin Account

Returns a list of strings

path Parameters
user_id
required
integer

The id number of the admin account logged in.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

register

handles starting an account and entering the account into the database

Puts a new admin account into the database

Request Body schema: application/json
username
required
string
email
required
string
password
required
string
role
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "John Doe",
  • "email": "johndoe@gmail.com",
  • "password": "john12345",
  • "role": "admin"
}

Response samples

Content type
application/json
{
  • "token": "c6fke676-676t-6767-67i6-67676",
  • "user": {
    }
}

Add a new child account to the database under the logged in Admin

Add a new child account to the database.

Request Body schema: application/json
username
required
string
guardian_id
required
integer
role
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "Jane Doe",
  • "guardian_id": 67,
  • "role": "child"
}

Response samples

Content type
application/json
{
  • "token": "c6fke676-676t-6767-67i6-67676",
  • "user": {
    }
}