Skip to content
tommywaaf edited this page Feb 19, 2023 · 36 revisions

/schedule/next

Returns the details of the next scheduled game that has not yet been played.

http://killhitstudios.com:5000/schedule/next

Request

Method

GET

URL path

/schedule/next

Response

Success response

Status code

200

Response format

JSON

Response fields

Field Type Description
gameId int The unique ID of the game.
team1 object The details of team 1 in the game.
team2 object The details of team 2 in the game.

team1 and team2 fields

Field Type Description
name string The name of the bot representing the team.
battleCapability string The battle capability of the bot representing the team.
wins int The number of wins for the bot.
losses int The number of losses for the bot.
botId string The unique ID of the bot.
imageId string The unique ID of the bot's image.

/bots/<bot_id>

Returns the details of a bot with the specified ID.

http://killhitstudios.com:5000/bots/4

Request

Method

GET

URL path

/bots/:bot_id

Request parameters

bot_id (required): The unique ID of the bot to retrieve.

Response

Success response

Status code

200

Response format

JSON

Response fields

Field Type Description
name string The name of the bot.
battleCapability string The battle capability of the bot.
wins int The number of wins for the bot.
losses int The number of losses for the bot.
botId string The unique ID of the bot.
imageId string The unique ID of the bot's image.

Error responses

Status code

404

Response format

JSON

Response fields

Field Type Description
error string The error message.

/schedule/<game_id>/game

Returns the details of a game with the specified ID.

http://killhitstudios.com:5000/schedule/4/game

Request

Method

GET

URL path

/schedule/:game_id/game

Request parameters

game_id (required): The unique ID of the game to retrieve.

Response

Success response

Status code

200

Response format

JSON

Response fields

Field Type Description
gameId int The unique ID of the game.
team1 object The details of team 1 in the game.
team2 object The details of team 2 in the game.
winner string The ID of the winning bot, not set until played.
resulttext string The text result of the game, not set until played.

team1 and team2 fields

Field Type Description
name string The name of the bot representing the team.
battleCapability string The battle capability of the bot representing the team.
wins int The number of wins for the bot.
losses int The number of losses for the bot.
botId string The unique ID of the bot.
imageId string The unique ID of the bot's image.

Error responses

Status code

400

Response format

JSON

Response fields

/schedule/<number_to_fetch>

Returns the details of the next scheduled games that have not yet been played, up to the specified number.

http://killhitstudios.com:5000/schedule/4

Request

Method

GET

URL path

/schedule/:number_to_fetch

Request parameters

number_to_fetch (required): The number of games to retrieve.

Response

Success response

Status code

200

Response format

JSON

Response fields

An array of game objects, each with the following fields:

Field Type Description
gameId int The unique ID of the game.
team1 object The details of team 1 in the game.
team2 object The details of team 2 in the game.

team1 and team2 fields

Field Type Description
name string The name of the bot representing the team.
battleCapability string The battle capability of the bot representing the team.
wins int The number of wins for the bot.
losses int The number of losses for the bot.
botId string The unique ID of the bot.
imageId string The unique ID of the bot's image.

Error responses

Status code

404

Response format

JSON

Response fields

Field Type Description
error string The error message.

/bots/leaderboard

Returns a leaderboard of the top bots based on their number of wins.

http://killhitstudios.com:5000/bots/leaderboard

Request

Method

GET

URL path

/bots/leaderboard

Response

Success response

Status code

200

Response format

JSON

Response fields

An array of bot objects, each with the following fields:

Field Type Description
botId string The unique ID of the bot.
wins int The number of wins for the bot.
losses int The number of losses for the bot.

Error responses

Status code

404

Response format

JSON

Response fields

Field Type Description
error string The error message.

/bots/<bot_id>/games

Returns a list of all games that the specified bot will or has played in.

http://killhitstudios.com:5000/bots/3/games

Request

Method

GET

URL path

/bots/:bot_id/games

Request parameters

bot_id (required): The unique ID of the bot.

Response

Success response

Status code

200

Response format

JSON

Response fields

An array of game objects, each with the following fields:

Field Type Description
gameId int The unique ID of the game.
team1 object The details of team 1 in the game.
team2 object The details of team 2 in the game.

team1 and team2 fields

Field Type Description
name string The name of the bot representing the team.
battleCapability string The battle capability of the bot representing the team.
wins int The number of wins for the bot.
losses int The number of losses for the bot.
botId string The unique ID of the bot.
imageId string The unique ID of the bot's image.

Error responses

Status code

404

Response format

JSON

Response fields

Field Type Description
error string The error message.

/battles/<game_id>

Runs a battle between the two bots of a game and returns the winner and the result text. Dont test once running.

Request

Method

POST

URL path

/battles/:game_id

Request parameters

game_id (required): The unique ID of the game.

Request body

The request body must be a JSON object with a gameId field set to the ID of the game.

Example:

{ "gameId": 123 }

Response

Success response

Status code

200

Response format

JSON

Response fields

Field Type Description
winner string The unique ID of the winning bot.
resulttext string The result text generated by OpenAI API.

Error responses

Status code

400

Response format

JSON

Response fields

Field Type Description
error string The error message.

Status code

404

Response format

JSON

Response fields

Field Type Description
error string The error message.

/bots/<bot_id>/image

Returns the image of the specified bot.

Request

Method

GET

URL path

/bots/:bot_id/image

Request parameters

bot_id (required): The unique ID of the bot.

Response

Success response

Status code

200

Response format

png

Error responses

Status code

404

Response format

png image

Clone this wiki locally