Competitions

Endpoints for managing competitions

Get competition by ID

get

Retrieves competition details by its ID. Requires access to the competition.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Responses
200

OK

*/*
get
/api/competitions/{compId}
put
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Body
namestringRequired

Name of the competition

Example: Code Battles 2023
descriptionstringRequired

Description of the competition

Example: A competitive coding event
startedAtstring · date-timeOptional

Start time of the competition

Example: 2023-01-01T10:00:00
endedAtstring · date-timeOptional

End time of the competition

Example: 2023-01-01T18:00:00
publicbooleanRequired

If public everyone can join into competition

Example: true
showInputbooleanRequired
showOutputbooleanRequired
showRatingbooleanRequired
Responses
200

OK

*/*
put
/api/competitions/{compId}

[ADMIN] Get competition users

get

Retrieves the list of users participating in a specific competition. Required admin role.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Responses
200

OK

*/*
get
/api/competitions/{compId}/users

[ADMIN] Edit competition users

put

Updates the list of users participating in a specific competition. Required admin role.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Body

Request to edit users

usersIdsinteger · int64[]Required

Set of user IDs to be edited

Example: 1,2,3
Responses
put
/api/competitions/{compId}/users

No content

[ADMIN] Edit competition checkers

put

Updates the list of checkers for a specific competition. Required admin role.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Body

Request to edit users

usersIdsinteger · int64[]Required

Set of user IDs to be edited

Example: 1,2,3
Responses
put
/api/competitions/{compId}/checkers

No content

[ADMIN] Get all competitions

get

Retrieves a list of all competitions. Required admin role.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

OK

*/*
get
/api/competitions

[ADMIN] Create a new competition

post

Creates a new competition object. Required admin role.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
namestringRequired

Name of the competition

Example: Code Battles 2023
descriptionstringRequired

Description of the competition

Example: A competitive coding event
startedAtstring · date-timeOptional

Start time of the competition

Example: 2023-01-01T10:00:00
endedAtstring · date-timeOptional

End time of the competition

Example: 2023-01-01T18:00:00
Responses
200

OK

*/*
post
/api/competitions

Submit an answer

post

Allows a user to submit an answer for a specific competition problem.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Body

Request to send an answer

checkerinteger · int64Required

ID of the checker

Example: 1
srcstringRequired

Source code submitted as the answer

Example: print(input())
idinteger · int64Required

ID of the answer

Example: 1001
Responses
200

OK

*/*
Responsestring
post
/api/competitions/{compId}/send

Join to public competition problem by ID

post

Every user can join to public competition.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Responses
200

OK

No content

post
/api/competitions/{compId}/publicJoin

No content

Get all answers

get

Retrieves all answers submitted by the authenticated user for a specific competition.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Responses
200

OK

*/*
get
/api/competitions/{compId}/sends

Get competition problems

get

Retrieves all problems associated with a specific competition.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Responses
200

OK

*/*
get
/api/competitions/{compId}/problems

Get competition problem by ID

get

Retrieves a specific problem by its ID within a competition.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
idinteger · int64Required
Responses
200

OK

*/*
get
/api/competitions/{compId}/problems/{id}

Get competition leaderboard

get

Retrieves the leaderboard for a specific competition.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
compIdinteger · int64Required
Responses
200

OK

*/*
get
/api/competitions/{compId}/leaderboard

Get all public competitions

get

Retrieves a list of public competitions.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

OK

*/*
get
/api/competitions/public

Get competitions available for user

get

Retrieves all competitions accessible to the authenticated user.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

OK

*/*
get
/api/competitions/me

Last updated

Was this helpful?