Skip to content
SuleGeredelioglu edited this page Sep 2, 2025 · 6 revisions

API Endpoints

This section outlines the available API endpoints provided by the backend service.

POST /create_configs

Description:
Creates configuration files using the provided .obj, .mtl, and config.yaml file paths. The resulting configs are saved in the configs directory.

Input:

  • obj_path: string
  • mtl_path: string
  • config_path: string

Output:

  • response: HTTP status code

Side Effect:

  • Writes map configuration files to the configs directory.

POST /upload_model_config

Description:
Uploads a base model file (.obj + .mtl) and a single config file (.yaml) to the uploads directory.

Input:

  • obj_path: string
  • mtl_path: string
  • config_path: string

Output:

  • response: HTTP status code

Side Effect:

  • Writes config file and base map files to the uploads directory.

POST /create_maps

Description:
Generates map files based on the existing configuration files.

Input:

  • base_map: string

Output:

  • response: HTTP status code

Side Effect:

  • Writes map files to the maps directory.

GET /configs/list

Description:
Returns a list of all config files in the configs directory (excluding info.txt).

Input:

  • None

Output:

  • "files": ["config1.yaml", "config2.yaml",...]

GET /configs/file/{filename}

Description:
Returns the requested config file for download.

Input:

  • filename: name of the config file

Output:

  • File download (if file exists)

GET /maps/list

Description:
Returns a list of all map files in the maps directory (excluding info.txt).

Input:

  • None

Output:

  • "files": ["map_abc123.json", "map_xyz789.json",...]

GET /maps/file/{filename}

Description:
Returns the requested map file for download.

Input:

  • filename: name of the map file

Output:

  • File download (if file exists)

GET /start_progress/{task_id}

Description:
Checks the progress tracking status for a given task ID.

Input:

  • task_id: string — Unique task identifier

Output:

  • response: JSON message confirming that progress tracking has started

Side Effect:

  • Starts an internal async task that progress values (0.0 to 1.0)

WebSocket /ws/progress/{task_id}

Description:
WebSocket connection to monitor progress for map generation.

Input:

  • task_id: string (in URL)

Output:

  • Sends periodic JSON messages

Side Effect:

  • Automatically closes connection after progress reaches 1.0.

DELETE /clear_configs

Description:
Deletes all files in the configs directory except for info.txt.

Input:

  • (None)

Output:

  • response: JSON status message

Side Effect:

  • Clears all config files in the configs folder except info.txt

DELETE /clear_maps

Description:
Deletes all files in the maps directory except for info.txt.

Input:

  • (None)

Output:

  • response: JSON status message

Side Effect:

  • Clears all map files in the maps folder except info.txt

DELETE /clear_uploads

Description:
Deletes all files in the uploads directory except for info.txt.

Input:

  • (None)

Output:

  • response: JSON status message

Side Effect:

  • Clears all config file and map files in the uploads folder except info.txt