Skip to main content

Retrieving route available for a driver

Projects available for a user

In the SWAT API, a project defines authorization boundaries for a user. Projects separate drivers, passengers, users, and settings across different accounts. A user (including drivers and passengers) can belong to multiple projects simultaneously. Projects are not intended for managing operation-specific cases.

To retrieve a list of projects available for a user, simply use project API

GET /api/v2/project

Routes assigned to a driver

A vehicle is a discrete entity, characterized by its unique identification and a pre-defined or dynamically assigned route. Conversely, a driver is a registered user within the system, possessing authenticated credentials and is assigned to operate specific vehicles. The assignment of a driver to a vehicle establishes a temporal relationship.

warning

This workflow requires a user to be associated with the project as a driver; project access alone is insufficient.

A consuming application can request assignments for a driver given that it authenticated itself as a relevant user (driver) by:

  • Requesting information of the current user as a driver using driver API with relevant filters
GET /api/v2/driver?user=13529&project=883
  • Requesting a list vehicles that the driver is assigned to using vehicle API with relevant filters
GET /api/v2/vehicle?order_by=start_time&order_by=id&driver=2503&simulation=162997&only_fields=agent_id,end_time,id,in_use,routing_engine_settings,service_number,simulation,start_time&not__is_invalidated=true&no_total_count=true
GET /api/v2/simulation/162997/vehicles_route_summary_info?vehicle_ids=1867318&no_total_count=true 
  • Accepting, marking pickup\drop off success\failure can be done using node actions

Vehicle route and polyline

Please refer to getting vehicle route