Stateful Navigation API (Split Audio/Data + Integrated Milestones)

API for audio-driven, turn-by-turn navigation. Uses a split audio/data flow for initiation. Navigation steps are provided intelligently based on proximity/time. Nearby user-defined Milestones are announced directly within navigation instructions.

Core Details


Audio Navigation Workflow

The main flow involves multiple steps due to separate audio/data submission and the stateful step loop:

Step 1: Upload Query Audio

POST /upload_audio

Uploads the user's spoken destination query.

Input

Output (JSON)

{ "status": "AudioReceived", "upload_id": "up_..." }
Save the `upload_id`.

Step 2: Send Location for Query

POST /process_query_location

Processes the query using the uploaded audio and location. Fetches milestones if navigation starts.

Input (application/json)

{
    "upload_id": "up_...", // From Step 1
    "latitude": float,
    "longitude": float,
    "heading": float // Optional
}

Output (JSON) - Key Scenarios


--- If Status was "AwaitingSelection", proceed to Steps 3 & 4 ---

Step 3: Upload Selection Audio

POST /upload_audio

Uploads the user's spoken POI option number.

Input

Output (JSON)

{ "status": "AudioReceived", "upload_id": "up_..." }
Save the NEW `upload_id`.

Step 4: Send Selection Context

POST /process_selection_location

Processes the selection, starts navigation, and fetches milestones.

Input (application/json)

{
    "upload_id": "up_...", // From Step 3
    "state_id": "poi_..."  // From Step 2
}

Output (JSON) - Key Scenarios


--- If Status was "NavigationStarted" (from Step 2 or Step 4), proceed to Step 5 ---

Step 5: Get Next Steps (Repeat with Smart Logic + Integrated Milestones)

POST /get_next_steps

Call periodically (e.g., every 5-10s). Server checks proximity to next turn AND nearby milestones, returning relevant instructions only.

Input: application/json

{
    "navigation_session_id": "nav_...", // Session ID from Step 2 or 4
    "latitude": CURRENT_LATITUDE,
    "longitude": CURRENT_LONGITUDE,
    "heading": CURRENT_HEADING // Optional
}

Output (JSON) - Key Scenarios (200 OK)

Milestone announcements are now part of the main audio/text fields, not a separate list.

Other Endpoints

Text POI Search

POST /search_poi

(Stateless) Input JSON: {"query", "latitude", "longitude"}. Returns JSON: {"status":"ok", "results": [...]}.

Start Text Navigation

POST /navigate

(Starts stateful session) Input JSON: {"destination_query", ...}. Returns JSON: {"status":"NavigationStarted", "navigation_session_id", ...}. Use `/get_next_steps` to continue.

API Documentation

GET /

Returns this HTML documentation.