School distedu

Schedule
Teacher
GET /teacher/groups
GET /teacher/subjects
get all teacher`'s groups
GET /teacher/groups

Request parameters

userId
string required

Responses

200 OK
Body
Object
groups
Array
Example:
["group","groupId"]
string
Example:
group
get all teacher`'s subjects
GET /teacher/subjects

Request parameters

userId
string required

Responses

200 OK
Body
Object
subjects
Array
Example:
["subject","subjectId"]
string
Example:
subject
User
POST /login
GET /profile
login
POST /login

Request parameters

email
string email required
password
string password required
Min length: 8

Responses

200 OK
Body
application/json
Object
token

JWT token

400 Bad Request
profile
GET /profile

Request headers

authorization
token required

JWT token

Responses

200 OK
Body
Object
email
string
Example:
vladd5@gmail.com
permission
400 Bad Request
user types
email

Email of a pupil/teacher

string

Email of a pupil/teacher

Methods: subject
Example 1
4930uhf0i34hf0h30
token

JWT token

string

JWT token

Example 1
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
permission
string
Enumeration:
pupil
admin
Methods: profile
Subject
GET /subject
subject
GET /subject

Request headers

token
token required

Request body

Object
subjectId
string

Id of a subject Math

Example:
fjodof4i34j3vfklldk
classId
string

Id of a class 1-A

Example:
hvforheif44j3vj430vj

Responses

200 OK
Body
Object
teacher
Object

Teacher of a subject

Example:
{ Teacher: {id: `ifn483odnf6odnio, name: `Natalia Petrovna`}}
email

Email of a teacher

name
string

Name of a teacher

Example:
Natalia Petrovna
Pupils
Array

Array of pupils of a given subject

Object
email

Email of a pupil

name
string

Name of a pupil

Example:
Vasya Petrov
Group
number

Pupil`s group within a subject

Example:
1
400 Bad Request
types
errors
Object
Example:
{
    "message": "invalid username or password",
    "code": 400,
    "params": {
        "name": "username",
        "value": "not found"
    }
}
message
string
Example:
invalid username or password
code
integer
Example:
400
params
Object
name
string
Example:
username
value
string
Example:
not found
Responses: Bad Request
Example 1
{"code":404,"message":"invalid username or password","params":[{"name":"username","value":"not found"}]}
400 Bad Request
Body
Operations: login profile subject