BlastPad
API Documentation
This document describes the API endpoints available from the Flask server.
GET /editor
Details
- Renders the Blockly editor.
- Optional Parameters:
- fromHomescreen: Makes the "Return to Home" button visible if true.
- game: Tries to load a specific game workspace if present.
GET /
Details
- Renders the Home Screen.
GET /icons/<path>
Details
- Returns a saved game icon from the
/icons
folder.
POST /save>
Details
- Attempts to save, compile, and test run a workspace.
- Expected Body: A Game Workspace
POST /saveWithoutRun>
Details
- Attempts to save and compile a workspace.
- Expected Body: A Game Workspace
GET /games
Details
- Returns an array of metadata describing locally saved games.
GET /games/<game_workspace_filename>
Details
- Returns the full JSON workspace of the specified game.
GET /run
Details
- Attempts to compile and run a game.
- Expected Parameters:
- game: Name of the game to run.
GET /compile
Details
- Attempts to compile a game.
- Expected Parameters:
- game: Name of the game to compile.
GET /test
Details
- Attempts to run a game for 5 seconds in the background.
- Expected Parameters:
- game: Name of the game to compile.
GET /get_wifi_networks
Details
- Returns available local access points.
POST /disconnect_wifi
Details
- Disconnects from the current access point.
POST /connect_to_wifi
Details
- Attempts to connect to a specified access point.
- Body:
- SSID: SSID of the desired access point.
- Password: Password for the desired access point.
GET /get/community/<search>
Details
- Returns game metadata from Supabase where game names fuzzy-match
<search>
. - Defaults to all games if
<search>
is not present.
GET /get/classroom/<classroom_id>/<search>
Details
- Returns game metadata from Supabase where game names belong to
<classroom_id>
and fuzzy-match<search>
. - Defaults to all games belonging to
<classroom_id>
if<search>
is not present.
POST /create/classroom
Details
- Creates a classroom based on the body of the request.
- Body:
- Classroom Data
- invite_code: String
- teacher: String
- title: String
- description: String
- Classroom Data
GET /share/community/<game_name>
Details
- Shares a game called
<game_name>
to the community hub.
GET /share/classroom/<classroom_id>/<game_name>
Details
- Shares a game called
<game_name>
to the classroom matching<classroom_id>
.
GET /join/classroom/<invite>
Details
- Joins a classroom with the invite code
<invite>
GET /leave/classroom/<invite>
Details
- Leaves a classroom with the invite code
<invite>
GET /download/community/<game_name>
Details
- Downloads a game from the community hub matching
<game_name>
.
GET /download/classroom/<classroom_id>/<game_name>
Details
- Downloads a game from the classroom with id
<classroom_id>
matching<game_name>
.
GET /running
Details
- Returns
{"success": "successful!}
.