Competition Problems

Endpoints for managing 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
*/*
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-06-30T18:46:23.746Z",
            "updatedAt": "2025-06-30T18:46:23.746Z",
            "authorities": [
              {
                "authority": "text"
              }
            ],
            "isAdmin": true,
            "username": "text",
            "password": "text",
            "enabled": true,
            "credentialsNonExpired": true,
            "accountNonExpired": true,
            "accountNonLocked": true
          }
        ],
        "checkers": [
          {
            "displayName": "text",
            "languageHighlightName": "text",
            "address": "text",
            "id": 1,
            "createdAt": "2025-06-30T18:46:23.746Z",
            "updatedAt": "2025-06-30T18:46:23.746Z"
          }
        ],
        "organizer": {
          "musername": "text",
          "mpassword": "text",
          "name": "text",
          "roles": [
            "USER"
          ],
          "id": 1,
          "createdAt": "2025-06-30T18:46:23.746Z",
          "updatedAt": "2025-06-30T18:46:23.746Z",
          "authorities": [
            {
              "authority": "text"
            }
          ],
          "isAdmin": true,
          "username": "text",
          "password": "text",
          "enabled": true,
          "credentialsNonExpired": true,
          "accountNonExpired": true,
          "accountNonLocked": true
        },
        "name": "text",
        "description": "text",
        "startedAt": "2025-06-30T18:46:23.746Z",
        "endedAt": "2025-06-30T18:46:23.746Z",
        "showRating": true,
        "showOutput": true,
        "showInput": true,
        "public": true,
        "id": 1,
        "createdAt": "2025-06-30T18:46:23.746Z",
        "updatedAt": "2025-06-30T18:46:23.746Z"
      },
      "problem": {
        "id": 1,
        "name": "text",
        "description": "text",
        "inData": "text",
        "outData": "text",
        "tests": "text",
        "examples": "text"
      },
      "id": 1,
      "createdAt": "2025-06-30T18:46:23.746Z",
      "updatedAt": "2025-06-30T18:46:23.746Z"
    }
  ],
  "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
*/*
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] Delete multiple competition problems

delete

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

Authorizations
Query parameters
idsinteger · int64[]Required
Responses
200
OK
delete
DELETE /api/competitionsProblems HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*

No content

[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[]
patch
PATCH /api/competitionsProblems HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
[
  1
]

[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
*/*
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
*/*
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] 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
*/*
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"
}

[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
*/*
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"
  }
]

Was this helpful?