Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

GET Endpoints

Vianney Veremme edited this page Nov 12, 2024 · 1 revision

Base Route

  1. Get server time
    • Endpoint: /, /time
    • Description: Retrieve the server time.

Player Routes

  1. Get all players

    • Endpoint: /players
    • Description: Retrieve a list of all players and their general details (e.g., id, name, email, gold, created_at, last_login).
  2. Get player by ID

    • Endpoint: /players/{player_id}
    • Description: Retrieve details of a specific player by id.
  3. Get player by email

    • Endpoint: /players/email/{email}
    • Description: Retrieve a specific player by their unique email (indexed for quick lookup).
  4. Get worlds of a player

    • Endpoint: /players/{player_id}/worlds
    • Description: Retrieve all worlds a player has joined by looking up entries in player_world.
  5. Get cities owned by a player

    • Endpoint: /players/{player_id}/cities
    • Description: Retrieve all cities owned by a player by using owner_id in city.

World Routes

  1. Get all worlds

    • Endpoint: /worlds
    • Description: Retrieve a list of all worlds and their configurations (e.g., id, name, description, seed, action_speed, etc.).
  2. Get world by ID

    • Endpoint: /worlds/{world_id}
    • Description: Retrieve details of a specific world by id.
  3. Get active worlds

    • Endpoint: /worlds/active
    • Description: Retrieve all worlds where STATUS is 1 (active).
  4. Get players in a world

    • Endpoint: /worlds/{world_id}/players
    • Description: Retrieve all players associated with a given world using player_world.
  5. Get islands in a world

    • Endpoint: /worlds/{world_id}/islands
    • Description: Retrieve all islands within a specific world.

Island Routes

  1. Get all islands

    • Endpoint: /islands
    • Description: Retrieve a list of all islands with their positions and associated world.
  2. Get island by ID

    • Endpoint: /islands/{island_id}
    • Description: Retrieve details of a specific island by id.
  3. Get cities on an island

    • Endpoint: /islands/{island_id}/cities
    • Description: Retrieve all cities located on a specific island.

City Routes

  1. Get all cities

    • Endpoint: /cities
    • Description: Retrieve a list of all cities, including coordinates, owner, and island details.
  2. Get city by ID

    • Endpoint: /cities/{city_id}
    • Description: Retrieve details of a specific city by id.
  3. Get cities in a world

    • Endpoint: /worlds/{world_id}/cities
    • Description: Retrieve all cities within a specified world (through islandcity relationships).

Building Routes

  1. Get all buildings

    • Endpoint: /buildings
    • Description: Retrieve a list of all buildings with names, levels, and city associations.
  2. Get buildings in a city

    • Endpoint: /cities/{city_id}/buildings
    • Description: Retrieve all buildings in a specific city.
  3. Get building by ID

    • Endpoint: /buildings/{building_id}
    • Description: Retrieve details of a specific building by id.
  4. Get building prerequisites

    • Endpoint: /buildings/{building_id}/prerequisites
    • Description: Retrieve all prerequisite buildings for a specified building by building_prerequisite.

Unit Routes

  1. Get all units

    • Endpoint: /units
    • Description: Retrieve a list of all units with their attributes (e.g., name, description, type, training_time, damage, etc.).
  2. Get units in a city

    • Endpoint: /cities/{city_id}/units
    • Description: Retrieve all units stationed in a city and their quantities using city_unit.
  3. Get unit by ID

    • Endpoint: /units/{unit_id}
    • Description: Retrieve details of a specific unit by id.

Battle Routes

  1. Get all battles

    • Endpoint: /battles
    • Description: Retrieve a list of all battles with attacker and defender details, time, winner, loser, and loot.
  2. Get battle by ID

    • Endpoint: /battles/{battle_id}
    • Description: Retrieve details of a specific battle by id.
  3. Get battles of a player

    • Endpoint: /players/{player_id}/battles
    • Description: Retrieve all battles involving a specified player as either attacker or defender.
  4. Get units in a battle

    • Endpoint: /battles/{battle_id}/units
    • Description: Retrieve all units involved in a specific battle, including their quantities and which side they fought on.

Miscellaneous Routes

  1. Get building requirements
    • Endpoint: /buildings/{building_id}/requirements
    • Description: Retrieve the resources required to build or upgrade a specific building based on building_requirement.

Clone this wiki locally