CodeBattles
Github
RU_v3
RU_v3
  • О системе V3
  • Обзор
    • Интерфейс участника
    • Интерфейс администратора
      • Задачи
      • Чекеры
      • Соревнования
  • Настройка и установка системы
    • Установка
      • Локальная установка
      • Production установка
  • Первое соревнование
    • Создать соревнование
  • Инструкции
    • Соревнование
      • Создание соревнования
      • Редактирование чекеров соревнования
      • Редактирование пользователей соревнования
      • Редактирование задач соревнования
    • Задачи
      • Добавить задачу
      • Изменить задачу
      • Удалить задачу
    • Пользователи
      • Регистрация пользователей
    • Чекеры
      • Создание чекера
      • Изменение чекера
      • Удаление чекера
  • Как работает система
    • Архитектура
    • Безопасность
  • API
    • Введение в API
    • Backend
      • Checkers
      • Competition Problems
      • Users
      • Answer
      • Competitions
      • Ping Pong
      • Problems
      • Auth
      • Checker system API
      • Models
    • Checker API
      • HealthCheck
      • Test
Powered by GitBook
On this page

Was this helpful?

  1. API
  2. Backend

Competition Problems

PreviousCheckersNextUsers

Was this helpful?

Endpoints for managing competition problems

[ADMIN] Delete multiple competition problems

delete

Deletes multiple competition problems by their IDs. Required admin role.

Authorizations
Query parameters
idsinteger · int64[]Required
Responses
200
OK
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
delete
DELETE /api/competitionsProblems HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*

No content

[ADMIN] Get competition problem by ID

get

Retrieves details of a specific competition problem by its ID. Required admin role.

Authorizations
Path parameters
idinteger · int64Required
Responses
200
OK
*/*
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
get
GET /api/competitionsProblems/{id} HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
{
  "id": 1,
  "priority": 12,
  "problem": {
    "id": 1,
    "name": "Sum of Two Numbers",
    "description": "Calculate the sum of two integers.",
    "inData": 1,
    "outData": 3,
    "examples": "Input: 1 2, Output: 3",
    "public": true
  },
  "slug": "text"
}

[ADMIN] Delete a competition problem

delete

Deletes a specific competition problem by its ID. Required admin role.

Authorizations
Path parameters
idinteger · int64Required
Responses
200
OK
*/*
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
delete
DELETE /api/competitionsProblems/{id} HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
{
  "id": 1,
  "priority": 12,
  "problem": {
    "id": 1,
    "name": "Sum of Two Numbers",
    "description": "Calculate the sum of two integers.",
    "inData": 1,
    "outData": 3,
    "examples": "Input: 1 2, Output: 3",
    "public": true
  },
  "slug": "text"
}

[ADMIN] Get multiple competition problems

get

Retrieves details of multiple competition problems by their IDs. Required admin role.

Authorizations
Query parameters
idsinteger · int64[]Required
Responses
200
OK
*/*
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
get
GET /api/competitionsProblems/by-ids HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
  {
    "id": 1,
    "priority": 12,
    "problem": {
      "id": 1,
      "name": "Sum of Two Numbers",
      "description": "Calculate the sum of two integers.",
      "inData": 1,
      "outData": 3,
      "examples": "Input: 1 2, Output: 3",
      "public": true
    },
    "slug": "text"
  }
]
  • GET[ADMIN] Get all competition problems
  • POST[ADMIN] Create a competition problem
  • DELETE[ADMIN] Delete multiple competition problems
  • PATCH[ADMIN] Update multiple competition problems
  • GET[ADMIN] Get competition problem by ID
  • DELETE[ADMIN] Delete a competition problem
  • PATCH[ADMIN] Update a competition problem
  • GET[ADMIN] Get multiple competition problems
Deprecated

[ADMIN] Get all competition problems

get

Retrieves a paginated list of all competition problems. Required admin role.

Authorizations
Query parameters
pageintegerOptional

Zero-based page index (0..N)

Default: 0
sizeinteger · min: 1Optional

The size of the page to be returned

Default: 20
sortstring[]Optional

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses
200
OK
*/*
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
get
GET /api/competitionsProblems HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
{
  "content": [
    {
      "priority": 1,
      "slug": "text",
      "competition": {
        "members": [
          {
            "musername": "text",
            "mpassword": "text",
            "name": "text",
            "roles": [
              "USER"
            ],
            "id": 1,
            "createdAt": "2025-05-24T09:32:31.666Z",
            "updatedAt": "2025-05-24T09:32:31.666Z",
            "username": "text",
            "authorities": [
              {
                "authority": "text"
              }
            ],
            "isAdmin": true,
            "password": "text",
            "enabled": true,
            "accountNonLocked": true,
            "accountNonExpired": true,
            "credentialsNonExpired": true
          }
        ],
        "checkers": [
          {
            "displayName": "text",
            "languageHighlightName": "text",
            "address": "text",
            "id": 1,
            "createdAt": "2025-05-24T09:32:31.666Z",
            "updatedAt": "2025-05-24T09:32:31.666Z"
          }
        ],
        "organizer": {
          "musername": "text",
          "mpassword": "text",
          "name": "text",
          "roles": [
            "USER"
          ],
          "id": 1,
          "createdAt": "2025-05-24T09:32:31.666Z",
          "updatedAt": "2025-05-24T09:32:31.666Z",
          "username": "text",
          "authorities": [
            {
              "authority": "text"
            }
          ],
          "isAdmin": true,
          "password": "text",
          "enabled": true,
          "accountNonLocked": true,
          "accountNonExpired": true,
          "credentialsNonExpired": true
        },
        "name": "text",
        "description": "text",
        "startedAt": "2025-05-24T09:32:31.666Z",
        "endedAt": "2025-05-24T09:32:31.666Z",
        "showRating": true,
        "showOutput": true,
        "showInput": true,
        "id": 1,
        "createdAt": "2025-05-24T09:32:31.666Z",
        "updatedAt": "2025-05-24T09:32:31.666Z"
      },
      "problem": {
        "id": 1,
        "name": "text",
        "description": "text",
        "inData": "text",
        "outData": "text",
        "tests": "text",
        "examples": "text"
      },
      "id": 1,
      "createdAt": "2025-05-24T09:32:31.666Z",
      "updatedAt": "2025-05-24T09:32:31.666Z"
    }
  ],
  "page": {
    "size": 1,
    "number": 1,
    "totalElements": 1,
    "totalPages": 1
  }
}

[ADMIN] Create a competition problem

post

Creates a new competition problem.

Authorizations
Body

Details for creating a competition problem

priorityinteger · int64Required

Priority of the problem in the competition

Example: 1
slugstringRequired

Slug identifier for the problem

Example: problem-slug
competition_idinteger · int64Required

ID of the competition

Example: 1001
problem_idinteger · int64Required

ID of the problem

Example: 2002
Responses
200
OK
*/*
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
post
POST /api/competitionsProblems HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 76

{
  "priority": 1,
  "slug": "problem-slug",
  "competition_id": 1001,
  "problem_id": 2002
}
{
  "id": 1,
  "priority": 12,
  "problem": {
    "id": 1,
    "name": "Sum of Two Numbers",
    "description": "Calculate the sum of two integers.",
    "inData": 1,
    "outData": 3,
    "examples": "Input: 1 2, Output: 3",
    "public": true
  },
  "slug": "text"
}

[ADMIN] Update multiple competition problems

patch

Applies partial updates to multiple competition problems. Required admin role.

Authorizations
Query parameters
idsinteger · int64[]Required
Body
anyOptional
Responses
200
OK
*/*
Responseinteger · int64[]
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
patch
PATCH /api/competitionsProblems HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
[
  1
]

[ADMIN] Update a competition problem

patch

Applies partial updates to a specific competition problem. Required admin role.

Authorizations
Path parameters
idinteger · int64Required
Body
anyOptional
Responses
200
OK
*/*
401
Unauthorized
*/*
403
Forbidden
*/*
500
Internal Server Error
*/*
patch
PATCH /api/competitionsProblems/{id} HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
{
  "id": 1,
  "priority": 12,
  "problem": {
    "id": 1,
    "name": "Sum of Two Numbers",
    "description": "Calculate the sum of two integers.",
    "inData": 1,
    "outData": 3,
    "examples": "Input: 1 2, Output: 3",
    "public": true
  },
  "slug": "text"
}