Metering distance

HyperTrack can help you accurately measure the distance and time traveled for Trips, Tasks and Drivers. This may be used to charge your customers for their orders, or reimburse drivers for fuel and maintenance costs, or measure the productivity of your workforce.

Trip summary

Integrating Trips

The Trip entity represents a journey for the Driver with a location stream, forming a polyline with distance. The locations from the Driver's device are filtered to remove the noise to ensure the distance is accurate.

To integrate, install the SDK on your preferred platform, and implement Trips.

Meter a Trip

Use this API request to get the distance covered in meters, time taken in seconds, and the route taken as an encoded polyline for a Trip object.

HTTP request

GET https://app.hypertrack.io/api/v1/trips/<id>/meter/

[info] Trip webhooks

You can alternatively use the trip.ended webhook to get the distance, time and polyline. Learn how to receive webhooks.

curl https://app.hypertrack.io/api/v1/trips/0002E720-63D2-42AB-A425-471763BF7F58/meter/ \
  -H "Authorization: token test_token" \
  -H "Content-Type: application/json" \
  -X GET

Example response

{
    "distance": 1092,  // in meters
    "driver": "5ab3217d-b70e-415e-b959-d224476a1070",
    "duration": 866.620527,  // in seconds
    "encoded_polyline": "knosBkeq{Lz{@lG",
    "ended_at": "2016-08-06T07:48:46.949000Z",
    "id": "0002e720-63d2-42ab-a425-471763bf7f58",
    "started_at": "2016-08-06T07:34:20.328473Z"
}

Meter a Task

Task metering shows time spent and distance traveled in completing that task. The API response returns the distance covered in meters, time taken in seconds, and the route taken as an encoded polyline for completing a task.

HTTP request

GET https://app.hypertrack.io/api/v1/tasks/<id>/meter/

curl https://app.hypertrack.io/api/v1/tasks/8b81f859-2014-4cac-b6bc-acfcd959aeae/meter/ \
  -H "Authorization: token test_token" \
  -H "Content-Type: application/json" \
  -X GET

Example response

{
    "distance": 383,  // in meters
    "driver_id": "e9fe0673-79c3-42c1-8231-1d8ebb8a5d75",
    "duration": 3974401.41,  // in seconds
    "encoded_polyline": "gzbtBsoi|L@C@EFIJO??NWDG??LQBE??uBLa@B??PxCAh@AJ??`@k@Ti@F[L]NSBET_@@C",
    "ended_at": "2016-08-27T04:13:37.933000Z",
    "id": "8b81f859-2014-4cac-b6bc-acfcd959aeae",
    "started_at": "2016-07-12T04:13:36.520901Z"
}

Meter a Driver

Driver metering shows total distance traveled by the driver in a given time period.

HTTP request

GET https://app.hypertrack.io/api/v1/drivers/<id>/meter/

Parameters

Parameter Required Description
id Yes The id of a driver who needs to be metered.
min_date No The starting time from which metering should be calculated for a driver
max_date No The end time until which metering should be calculated for a driver
curl "https://app.hypertrack.io/api/v1/drivers/c130a046-8b5a-4092-983b-f79aaedfe629/meter/?min_date=2016-05-01&max_date=2016-05-31/" \
  -H "Authorization: token test_token" \
  -H "Content-Type: application/json" \
  -X GET

Example response

{
    "driver_id": "c130a046-8b5a-4092-983b-f79aaedfe629",
    "distance": 44626  // in meters
}

Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""