Competitions
Endpoints for managing competitions
Retrieves competition details by its ID. Requires access to the competition.
GET /api/competitions/{compId} HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
{
"id": 1,
"checkers": [
{
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
}
],
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
Name of the competition
Code Battles 2023
Description of the competition
A competitive coding event
Start time of the competition
2023-01-01T10:00:00
End time of the competition
2023-01-01T18:00:00
If public everyone can join into competition
true
PUT /api/competitions/{compId} HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 204
{
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
{
"id": 1,
"checkers": [
{
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
}
],
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
Retrieves the list of users participating in a specific competition. Required admin role.
GET /api/competitions/{compId}/users HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
{
"id": 1,
"username": "john_doe"
}
]
Updates the list of users participating in a specific competition. Required admin role.
Request to edit users
Set of user IDs to be edited
1,2,3
PUT /api/competitions/{compId}/users HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 20
{
"usersIds": "1,2,3"
}
No content
Updates the list of checkers for a specific competition. Required admin role.
Request to edit users
Set of user IDs to be edited
1,2,3
PUT /api/competitions/{compId}/checkers HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 20
{
"usersIds": "1,2,3"
}
No content
Retrieves a list of all competitions. Required admin role.
GET /api/competitions HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
{
"id": 1,
"checkers": [
{
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
}
],
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
]
Creates a new competition object. Required admin role.
Name of the competition
Code Battles 2023
Description of the competition
A competitive coding event
Start time of the competition
2023-01-01T10:00:00
End time of the competition
2023-01-01T18:00:00
POST /api/competitions HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 137
{
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00"
}
{
"id": 1,
"checkers": [
{
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
}
],
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
Allows a user to submit an answer for a specific competition problem.
Request to send an answer
ID of the checker
1
Source code submitted as the answer
print(input())
ID of the answer
1001
POST /api/competitions/{compId}/send HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 46
{
"checker": 1,
"src": "print(input())",
"id": 1001
}
text
Every user can join to public competition.
POST /api/competitions/{compId}/publicJoin HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
No content
Retrieves all answers submitted by the authenticated user for a specific competition.
GET /api/competitions/{compId}/sends HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
{
"id": 1,
"user": {
"id": 1,
"username": "john_doe"
},
"status": "IN_PROGRESS",
"score": 100,
"code": "print('Hello, World!')",
"result": "Success",
"checker": {
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
},
"createdAt": "2023-01-01T12:00:00Z",
"competitionsProblems": {
"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"
}
}
]
Retrieves all problems associated with a specific competition.
GET /api/competitions/{compId}/problems 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"
}
]
Retrieves a specific problem by its ID within a competition.
GET /api/competitions/{compId}/problems/{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"
}
Retrieves the leaderboard for a specific competition.
GET /api/competitions/{compId}/leaderboard HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
{
"score": [
{
"userId": 1,
"userX": "text",
"score": 1,
"time": "2025-06-30T18:46:46.952Z"
}
],
"data": {
"ANY_ADDITIONAL_PROPERTY": [
{
"userId": 1,
"competitionproblemId": 1,
"maxScore": 1
}
]
}
}
Retrieves a list of public competitions.
GET /api/competitions/public HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
{
"id": 1,
"checkers": [
{
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
}
],
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
]
Retrieves all competitions accessible to the authenticated user.
GET /api/competitions/me HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
{
"id": 1,
"checkers": [
{
"id": 1,
"displayName": "Default Python3 Checker",
"languageHighlightName": "python"
}
],
"name": "Code Battles 2023",
"description": "A competitive coding event",
"startedAt": "2023-01-01T10:00:00",
"endedAt": "2023-01-01T18:00:00",
"public": true,
"showInput": true,
"showOutput": true,
"showRating": true
}
]
Was this helpful?