HyperTrack provides a simple API call to get a list of nearest available drivers based on how far they are from an address. The goal of this API is to get simple and actionable data with respect to location, which you may use in conjunction with your proprietary business logic to make smart assignments.
When you are ready to assign a task, call the API and get a list of nearest available drivers, by minutes.
The Shift entity in the HyperTrack API is a period where the current location of the Driver is made available for queries, like getting the nearby drivers.
Get nearby drivers
After you have integrated shifts in your app, use the following HTTP Request to get the list of drivers.
|location||Yes||The latitude-longitude of the location from where you want to find the closest drivers. The location parameter is given as latitude,longitude (eg, location=28.1248,77.89712)|
|radius||No||The radius in meters within which you want to look for drivers.|
|page_size||No||The maximum number of drivers that you want the API to return.|
|fleet_id||No||The id of the fleet within which you want to search for drivers. If you don't specify a fleet, we will returns drivers from all fleets.|
This is a example request that you can use to get the 5 drivers closest to 101 Main Street, San Francisco, which is latitude 37.7918374, longitude -122.3971378.
curl "https://app.hypertrack.io/api/v1/drivers/nearby/?location=37.7918374,-122.3971378" -H "Authorization: token test_token"