Tournaments API documentation
Back-end for tournament management application.
Sign up
Create a new user account.
post /users/sign_up
Create a new user account.
Body
Media type: application/json
Type: object
Properties- user: required(object)
- email: required(string)
- password: required(string)
- password_confirmation: required(string)
HTTP status code 201
Body
Media type: application/json
Type: object
Properties- user: required(object)
- email: required(string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 422
Returned when sent parameters are not valid.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, for validation error it is always "invalid_params".
- error_description: required(string)
Human-readable error message.
- fields: required(object)
An object containing all errors. Object keys are field names, values are error messages (arrays of string).
Authentication
Create an access token that allows user to authenticate.
post /oauth/token
Create an access token that allows user to authenticate.
Query Parameters
- email: required(string)
- password: required(string)
- grant_type: required(password)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- access_token: required(string)
- created_at: required(integer)
- expires_in: required(integer)
- refresh_token: required(string)
- token_type: required(string)
Example:
{
"access_token": "fdf22ac62f7007c2a63291485446650e01637a986db59364e33761838e109ee4",
"created_at": 1515571806,
"expires_in": 7200,
"refresh_token": "8a737a12ea6a3182aa9924b277d67d55c92f67fa3d03f5016aa50c787ea513b0",
"token_type": "bearer"
}
HTTP status code 401
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
Example:
{
"error": "invalid_grant",
"error_description": "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
}
Retrieve details about the token used for authentication.
get /oauth/token/info
Retrieve details about the token used for authentication.
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- application: required(object)
- uid: required(nil)
- created_at: required(integer)
- expires_in: required(integer)
- resource_owner_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- scope: required(array of string)
Example:
{
"application": {
"uid": null
},
"created_at": 1515572788,
"expires_in": 100,
"resource_owner_id": "6a15b02f-0712-56dc-a290-915475d29abb",
"scope": [
"public"
]
}
HTTP status code 401
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
Example:
{
"error": "invalid_request",
"error_description": "The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed."
}
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Revoke the given token.
post /oauth/revoke
Revoke the given token.
HTTP status code 200
Always returns 200 OK, even if token doesn't exist or has already been revoked.
Body
Media type: application/json
Type: any
Example:
{}
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
User
Retrieve account details for currently authenticated user.
Update account details for currently authenticated user.
get /user
Retrieve account details for currently authenticated user.
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- user: required(object)
- email: required(string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
patch /user
Update account details for currently authenticated user.
Body
Media type: application/json
Type: object
Properties- user: required(object)
- email: (string)
- password: (string)
- password_confirmation: (string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- user: required(object)
- email: required(string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 422
Returned when sent parameters are not valid.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, for validation error it is always "invalid_params".
- error_description: required(string)
Human-readable error message.
- fields: required(object)
An object containing all errors. Object keys are field names, values are error messages (arrays of string).
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Tournaments
Retrieve tournaments. Authentication is optional - when authenticated, retrieve only tournaments created by authenticated user. Tournaments are sorted by 'starts_at' (ascending).
Create a new tournament.
get /tournaments
Retrieve tournaments. Authentication is optional - when authenticated, retrieve only tournaments created by authenticated user. Tournaments are sorted by 'starts_at' (ascending).
Query Parameters
- filters: (object)
- starts_at_after:
(datetime)
Specify datetime after which tournaments you want to retrieve should start.
- with_name: (string)
Specify tournament name you want to search for (case insensitive).
- starts_at_after:
(datetime)
- page: (integer - default: 1)
Specify the page that you want to retrieve, 12 results are returned per page.
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- tournaments: required(array
of object)
Items: Tournament
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
- meta: required(object)
- total_count: required(integer)
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
post /tournaments
Create a new tournament.
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors_limit: required(integer)
- description: required(string)
- name: required(string)
- starts_at: required(datetime)
- result_names: required(array of string)
HTTP status code 201
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 422
Returned when sent parameters are not valid.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, for validation error it is always "invalid_params".
- error_description: required(string)
Human-readable error message.
- fields: required(object)
An object containing all errors. Object keys are field names, values are error messages (arrays of string).
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Retrieve tournaments that currently authenticated user has enlisted in. Tournaments are sorted by 'starts_at' (ascending).
get /tournaments/enlisted
Retrieve tournaments that currently authenticated user has enlisted in. Tournaments are sorted by 'starts_at' (ascending).
Query Parameters
- filters: (object)
- starts_at_after:
(datetime)
Specify datetime after which tournaments you want to retrieve should start.
- with_name: (string)
Specify tournament name you want to search for (case insensitive).
- starts_at_after:
(datetime)
- page: (integer - default: 1)
Specify the page that you want to retrieve, 12 results are returned per page.
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- tournaments: required(array
of object)
Items: Tournament
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
- meta: required(object)
- total_count: required(integer)
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Retrieve a tournament with relations.
Update tournament details. User can update only tournaments he created.
Remove a tournament. User can remove only tournaments he created.
get /tournaments/{id}
Retrieve a tournament with relations.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors: required(array of
Competitor)
Items: Competitor
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- status: required(one of enlisted, confirmed)
- user_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- rounds: required(array
of RoundWithRelations)
Items: Round
- players: required(array
of Player)
Items: Player
- competitor_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_values: required(array of integer)
- table_number: required(integer)
- competitors_limit: required(integer)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- tables_count: required(integer)
- players: required(array
of Player)
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
- competitors: required(array of
Competitor)
HTTP status code 404
Returned when resource was not found. Response is always empty.
patch /tournaments/{id}
Update tournament details. User can update only tournaments he created.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors_limit: required(integer)
- description: required(string)
- name: required(string)
- starts_at: required(datetime)
- result_names: required(array of string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
HTTP status code 422
Returned when sent parameters are not valid.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, for validation error it is always "invalid_params".
- error_description: required(string)
Human-readable error message.
- fields: required(object)
An object containing all errors. Object keys are field names, values are error messages (arrays of string).
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
delete /tournaments/{id}
Remove a tournament. User can remove only tournaments he created.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
HTTP status code 204
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Mark tournament as 'in progress'. User can start only tournaments he created and their 'starts_at' date is in the past.
post /tournaments/{id}/start
Mark tournament as 'in progress'. User can start only tournaments he created and their 'starts_at' date is in the past.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Mark tournament as 'ended'. User can start only tournaments he created and were previously started.
post /tournaments/{id}/end
Mark tournament as 'ended'. User can start only tournaments he created and were previously started.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- tournament: required(object)
- competitors_limit: required(integer)
- description: (string)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- organiser_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_names: required(array of string)
- starts_at: required(datetime)
- status: required(one of created, in_progress, ended)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Results
Retrieve total results for each competitor in a tournament, sorted from highest to lowest.
get /results
Retrieve total results for each competitor in a tournament, sorted from highest to lowest.
Query Parameters
- tournament_id: required(string
- pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- results: required(array
of object)
Items: Result
- competitor_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- total: required(array of integer)
HTTP status code 404
Returned when resource was not found. Response is always empty.
Competitor
Enlist in a tournament. User can enlist only in tournaments that didn't start.
Resign from a tournament. User can resign only from tournaments that didn't start.
post /competitor
Enlist in a tournament. User can enlist only in tournaments that didn't start.
Query Parameters
- tournament_id: required(string
- pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
Body
Media type: application/json
Type: object
Properties- competitor: required(object)
- name: required(string)
Name under which user wants to participate in a tournament. Must be unique within that tournament.
- name: required(string)
HTTP status code 201
Body
Media type: application/json
Type: object
Properties- competitor: required(object)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- status: required(one of enlisted, confirmed)
- user_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
delete /competitor
Resign from a tournament. User can resign only from tournaments that didn't start.
Query Parameters
- tournament_id: required(string
- pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
HTTP status code 204
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Create a competitor for user without an account. User can create competitors only in tournaments he created.
post /competitor/add
Create a competitor for user without an account. User can create competitors only in tournaments he created.
Query Parameters
- tournament_id: required(string
- pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
Body
Media type: application/json
Type: object
Properties- competitor: required(object)
- name: required(string)
Name under which user wants to participate in a tournament. Must be unique within that tournament.
- name: required(string)
HTTP status code 201
Body
Media type: application/json
Type: object
Properties- competitor: required(object)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- status: required(one of enlisted, confirmed)
- user_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Competitors
Remove competitor from a tournament. User can remove only competitors he created.
delete /competitors/{id}/remove
Remove competitor from a tournament. User can remove only competitors he created.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the competitor
HTTP status code 204
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Confirm user participation in a tournament. User can confirm competitors only in tournaments he created.
post /competitors/{id}/confirm
Confirm user participation in a tournament. User can confirm competitors only in tournaments he created.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the competitor
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- competitor: required(object)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- status: required(one of enlisted, confirmed)
- user_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Reject user participation in a tournament. User can reject competitors only in tournaments he created.
post /competitors/{id}/reject
Reject user participation in a tournament. User can reject competitors only in tournaments he created.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the competitor
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- competitor: required(object)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- name: required(string)
- status: required(one of enlisted, confirmed)
- user_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Rounds
Create a new tournament round. User can create rounds only in tournaments he created and didn't end.
post /rounds
Create a new tournament round. User can create rounds only in tournaments he created and didn't end.
Query Parameters
- tournament_id: required(string
- pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the tournament
Body
Media type: application/json
Type: object
Properties- round: required(object)
- competitors_limit: required(integer)
- tables_count: required(integer)
HTTP status code 201
Body
Media type: application/json
Type: object
Properties- round: required(object)
- competitors_limit: required(integer)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- tables_count: required(integer)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Update tournament round. User can update rounds only in tournaments he created and didn't end.
Remove tournament round. User can remove rounds only in tournaments he created and didn't end.
patch /rounds/{id}
Update tournament round. User can update rounds only in tournaments he created and didn't end.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the round
Body
Media type: application/json
Type: object
Properties- round: required(object)
- competitors_limit: required(integer)
- tables_count: required(integer)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- round: required(object)
- competitors_limit: required(integer)
- created_at: required(datetime)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- tables_count: required(integer)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
HTTP status code 422
Returned when sent parameters are not valid.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, for validation error it is always "invalid_params".
- error_description: required(string)
Human-readable error message.
- fields: required(object)
An object containing all errors. Object keys are field names, values are error messages (arrays of string).
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
delete /rounds/{id}
Remove tournament round. User can remove rounds only in tournaments he created and didn't end.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the round
HTTP status code 204
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Players
Assign players to tables in a tournament round. For the first round assignment is random. If consecutive rounds have the same competitors limit and tables count, algorithm tries to pair up competitors who haven't met yet. Otherwise it's based on score. User can assign players only in tournaments he created.
post /players
Assign players to tables in a tournament round. For the first round assignment is random. If consecutive rounds have the same competitors limit and tables count, algorithm tries to pair up competitors who haven't met yet. Otherwise it's based on score. User can assign players only in tournaments he created.
Query Parameters
- round_id: required(string
- pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the round
HTTP status code 201
Body
Media type: application/json
Type: object
Properties- players: required(array
of object)
Items: Player
- competitor_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_values: required(array of integer)
- table_number: required(integer)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho
Update player with the round results.
patch /players/{id}
Update player with the round results.
URI Parameters
- id: required(string - pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
The id of the player
Body
Media type: application/json
Type: object
Properties- player: required(object)
- result_values: required(array of integer)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- player: required(object)
- competitor_id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- id: required(string - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)
- result_values: required(array of integer)
- table_number: required(integer)
HTTP status code 401
Returned when request was not authenticated properly. Response is always empty.
HTTP status code 403
Returned when action is not allowed, e.g. required conditions are not met.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, e.g. "forbidden".
- error_description: required(string)
Human-readable error message.
HTTP status code 404
Returned when resource was not found. Response is always empty.
HTTP status code 422
Returned when sent parameters are not valid.
Body
Media type: application/json
Type: object
Properties- error: required(string)
Error code, for validation error it is always "invalid_params".
- error_description: required(string)
Human-readable error message.
- fields: required(object)
An object containing all errors. Object keys are field names, values are error messages (arrays of string).
Secured by oauth
Headers
- Authorization: required(string)
Example:
Bearer iDbsaZHplNEL1thqvGsfYFyb_4P4Fv6uCCAGcENK_ho