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 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
- Payload
Content type
application/json
{- "email": "bob@gmail.com",
- "password": "12345B"
}Response samples
- 200
- 400
Content type
application/json
{- "message": "Login successful",
- "role": "admin",
- "token": "c6fke676-676t-6767-67i6-67676",
- "user_id": 67
}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
- 200
- 400
Content type
application/json
{- "status": "success",
- "user_id": 67,
- "preferred_words": [
- "dinosaur"
], - "interests": [
- "books"
]
}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
- Payload
Content type
application/json
{- "username": "John Doe",
- "email": "johndoe@gmail.com",
- "password": "john12345",
- "role": "admin"
}Response samples
- 200
- 400
Content type
application/json
{- "token": "c6fke676-676t-6767-67i6-67676",
- "user": {
- "email": "johndoe@gmail.com",
- "id": 67,
- "password": "john12345",
- "role": "admin",
- "username": "John"
}
}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
- Payload
Content type
application/json
{- "username": "Jane Doe",
- "guardian_id": 67,
- "role": "child"
}Response samples
- 200
Content type
application/json
{- "token": "c6fke676-676t-6767-67i6-67676",
- "user": {
- "guardian": 67,
- "id": 69,
- "role": "child",
- "username": "Jane Doe"
}
}