Problems
Endpoints for managing problems
Retrieves a list of all problems.
OK
Unauthorized
Forbidden
Conflict
Internal Server Error
GET /api/problems HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{}Creates a new problem using the provided data.
Name of the problem
Sum of Two NumbersDescription of the problem
Calculate the sum of two integers.Input data for the problem
1Expected output data for the problem
3Test cases for the problem (JSON)
{"in":"1","out":"3"}Example cases for the problem (JSON)
{"in":"1","out":"3"}OK
Unique identifier of the problem
1Name of the problem
Sum of Two NumbersDescription of the problem
Calculate the sum of two integers.Input data for the problem
1Expected output data for the problem
3Example cases for the problem
Input: 1 2, Output: 3Indicates if the problem is public
trueUnauthorized
Forbidden
Conflict
Internal Server Error
POST /api/problems HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 164
{
"name": "Sum of Two Numbers",
"description": "Calculate the sum of two integers.",
"inData": 1,
"outData": 3,
"tests": {
"in": "1",
"out": "3"
},
"examples": {
"in": "1",
"out": "3"
}
}{
"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
}Retrieves a problem by its ID. Required admin role
OK
Unique identifier of the problem
1Name of the problem
Sum of Two NumbersDescription of the problem
Calculate the sum of two integers.Input data for the problem
1Expected output data for the problem
3Example cases for the problem
Input: 1 2, Output: 3Indicates if the problem is public
trueUnauthorized
Forbidden
Conflict
Internal Server Error
GET /api/problems/{id} HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"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
}Applies partial updates to a problem by its ID.
OK
Unauthorized
Forbidden
Conflict
Internal Server Error
PATCH /api/problems/{id} HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
{
"id": 1,
"name": "text",
"description": "text",
"inData": "text",
"outData": "text",
"tests": "text",
"examples": "text"
}Retrieves a problem by its ID with admin-level access. Required admin role
OK
Unauthorized
Forbidden
Conflict
Internal Server Error
GET /api/problems/{id}/admin HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 1,
"name": "text",
"description": "text",
"inData": "text",
"outData": "text",
"tests": "text",
"examples": "text"
}Last updated