Answer
Endpoints for answers
Retrieves answer details by its ID. Requires access to the answer.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idinteger · int64Required
Responses
200
OK
*/*
idinteger · int64OptionalExample:
Unique identifier of the answer
1statusstring · enumRequiredExample:
Current status of the answer
IN_PROGRESSPossible values: scoreinteger · int32OptionalExample:
Score awarded for the answer
100codestringRequiredExample:
Code submitted by the user
print('Hello, World!')resultstringOptionalExample:
Result of the code execution
SuccesscreatedAtstring · date-timeRequiredExample:
Timestamp when the answer was created
2023-01-01T12:00:00Z401
Unauthorized
*/*
403
Forbidden
*/*
409
Conflict
*/*
500
Internal Server Error
*/*
get/api/answers/{id}
GET /api/answers/{id} HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
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 the most recent answer submitted by a specific user for a specific competition problem. Required admin role.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
compProblemIdinteger · int64Required
The ID of CompetitionProblem id
userIdinteger · int64Required
The ID of the user
Responses
200
OK
*/*
idinteger · int64OptionalExample:
Unique identifier of the answer
1statusstring · enumRequiredExample:
Current status of the answer
IN_PROGRESSPossible values: scoreinteger · int32OptionalExample:
Score awarded for the answer
100codestringRequiredExample:
Code submitted by the user
print('Hello, World!')resultstringOptionalExample:
Result of the code execution
SuccesscreatedAtstring · date-timeRequiredExample:
Timestamp when the answer was created
2023-01-01T12:00:00Z401
Unauthorized
*/*
403
Forbidden
*/*
409
Conflict
*/*
500
Internal Server Error
*/*
get/api/answers/last
GET /api/answers/last?compProblemId=1&userId=1 HTTP/1.1
Host: localhost:8080
Authorization: Bearer YOUR_SECRET_TOKEN
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"
}
}Last updated