API Endpoints
This document outlines the available API endpoints for managing window controls, team actions, and application settings. All endpoints are prefixed with http://localhost:8080/api
.
The API is divided into three main categories:
Window Actions
The api/window/
endpoints manage the application’s window states and utilities.
Endpoint | Method | Description |
---|---|---|
/api/window/toggleWindow | GET | Toggles the main window between open and closed states. |
/api/window/minimizeWindow | GET | Minimizes the main window to the taskbar. |
/api/window/closeWindow | GET | Hides the main window without exiting the app. |
/api/window/openWindow | GET | Opens the main window if it’s hidden or closed. |
/api/window/toggleOrientation | GET | Switches the main window’s orientation (e.g., horizontal/vertical). |
/api/window/hotkeyManager | GET | Opens the hotkey manager window. |
/api/window/checkForUpdates | GET | Checks for available application updates. |
/api/window/about | GET | Opens the “About” window with app details. |
/api/window/getAppVersion | GET | Returns the current application version as a string. |
/api/window/getHotkeys | GET | Retrieves a list of all configured hotkeys. |
Example
To toggle the window:
GET http://localhost:8080/api/window/toggleWindow
Response: 200 OK
on success.
Team Actions
The api/team/
endpoints manage team-related data, such as scores, names, and appearances.
Endpoint | Method | Query Parameters | Description |
---|---|---|---|
/api/team/swapTeams | GET | None | Swaps the positions of the two teams. |
/api/team/resetTeams | GET | None | Resets all team data to default values. |
/api/team/updateMatchData | GET | None | Refreshes the current match data. |
/api/team/increment | GET | team (required) | Increments the score of the specified team by 1. |
/api/team/decrement | GET | team (required) | Decrements the score of the specified team by 1. |
/api/team/setScore | GET | team (required), score (required) | Sets the score for the specified team. |
/api/team/setTeamName | GET | team (required), name (required) | Updates the name of the specified team. |
/api/team/setTeamInfo | GET | team (required), info (required) | Sets additional info (e.g., description) for the team. |
/api/team/setTeamColor | GET | team (required), color (required) | Sets the team’s color using a hex code (e.g., FF5733 ). |
/api/team/setTeamLogo | GET | team (required), logo (required) | Sets the team’s logo (local path or URL). |
Parameters
team
: Must be1
or2
to specify the target team.score
: An integer value (e.g.,10
).color
: A hex color code without#
(e.g.,FF5733
for orange).logo
: A file path (e.g.,C:/logos/team1.png
) or URL (e.g.,https://example.com/logo.png
).
Example
To set Team 1’s score to 5:
GET http://localhost:8080/api/team/setScore?team=1&score=5
Response: 200 OK
on success, 400 Bad Request
if parameters are missing.
App Actions
The api/app/
endpoints handle application-level configurations.
Endpoint | Method | Query Parameters | Description |
---|---|---|---|
/api/app/selectgameconfig | GET | id (required) | Selects a game configuration by its ID. |
/api/app/selectgameconfig | GET | None | Returns the current game configuration (if no id is provided). |
Parameters
id
: A unique identifier for the game config (e.g.,config-123
).
Example
To select a game config:
GET http://localhost:8080/api/app/selectgameconfig?id=config-123
Response: 200 OK
on success.
General Notes
- Base URL: All endpoints are accessed via
http://localhost:8080/api
. - Success Response: Returns
200 OK
unless otherwise specified. - Error Handling: Missing or invalid query parameters result in a
400 Bad Request
. - Hotkeys: Retrieved via
/api/window/getHotkeys
as a JSON object. - Team Values: The
team
parameter must be1
or2
.
Last updated on