This document describes all available backend API endpoints for the R7L platform. All endpoints are prefixed with /api/.
Authenticate user and get JWT token.
- Body:
{ login: string, password: string } - Response:
{ id, login, positionName, email, firstName, lastName, registrationDate, token }
Register a new user.
- Body:
{ login, email, password, firstName, lastName, positionId } - Response: Same as Authenticate
Get user info by id (admin or self).
- Auth: JWT required
- Response: UserReadDTO
Get current user info.
- Auth: JWT required
- Response: UserReadDTO
Update current user info.
- Auth: JWT required
- Body: UserUpdateDTO
Change current user password.
- Auth: JWT required
- Body:
{ oldPassword, newPassword }
Check if login/email are unique.
- Body:
{ login, email } - Response:
{ LoginIsUnique, EmailIsUnique }
Get all courses.
- Response:
CourseReadDTO[]
Create a new course.
- Body: CourseCreateDTO
- Response: CourseReadDTO
Get all units for a course.
- Response: CourseUnitReadDTO[]
Create a course unit.
- Body: CourseUnitCreateDTO
- Response: CourseUnitReadDTO
Update a course unit.
- Body: CourseUnitUpdateDTO
Change unit order in course.
Delete a course unit.
Get current user's progress in a course.
- Auth: JWT required
- Response: CourseUnitProgressReadDTO[]
Update progress for a course unit.
- Auth: JWT required
- Body: CourseUnitProgressUpdateDTO
Get test for a course unit.
- Response: TestReadDTO
Create a test.
- Body: TestCreateDTO
- Response: test id
Create a test question.
- Body: TestQuestionCreateDTO
- Response: question id
Create a test question option.
- Body: TestQuestionOptionCreateDTO
- Response: option id
Update a test.
- Body: TestUpdateDTO
Update a test question.
- Body: TestQuestionUpdateDTO
Update a test question option.
- Body: TestQuestionOptionUpdateDTO
Delete a test question.
Delete a test question option.
Update or create user test answer.
- Auth: JWT required
- Body: TestAnswerDTO
- Response: user test degree (int)
Get public resource (image, etc).
List files in a directory.
Get internal resource (local network only).
Get resource (auth required).
Upload a resource file.
- Auth: JWT required
- Form: file, subdir, courseId, orderInCourse, name
- Response:
{ path }
Upload a temporary exercise file.
- Auth: JWT, student role
- Form: file, userId
- Response:
{ path }
- Most endpoints return HTTP 400 with error message on failure.
- Auth endpoints return 401/403 on unauthorized/forbidden.
For more details on request/response formats, see DTO definitions in the backend source code.