GPS Log

A GPS Log object represents the GPS data sent by the driver's device.

The GPS Log object

Property Type Description
id uuid string Unique identifier for the object
driver_id uuid string The id of the driver to which the object belongs
location GeoJSON point The latitude and longitude of the object
location_accuracy float The accuracy of the location in meters
speed float The speed of the driver in meters/second
bearing float The bearing of the object in degrees from the N-S axis
altitude float The altitude above sea level of the location in meters
activities array of strings Activities recorded with the location
activity_confidence integer Confidence level of the activities recorded, from 0-100
recorded_at ISO datetime string Timestamp of when location was recorded
created_at ISO datetime string Timestamp of when location was created
modified_at ISO datetime string Timestamp of when location was modified

Create a GPS Log

Creates a new gpslog object.

HTTP Request

POST https://app.hypertrack.io/api/v1/gps/

Returns

Empty response, to minimize response payload.

Parameters

Parameter Required Description
driver_id Yes The driver id to which this location belongs
location Yes The location recorded
recorded_at Yes The timestamp at which the location was recorded
location_accuracy No The location accuracy of the location in meters
speed No The speed in meters/speed
bearing No The bearing in degrees from the N-S axis
altitude No The altitude above sea level in meters
activities No List of activities recorded with the location. Possible activities are stationary, walking, running, automotive, cycling or unknown
activity_confidence No Confidence level of the recorded activities, between 0 to 100
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X POST \
     -d "{\"driver_id\": \"41caa9f2-ad63-4a8b-98ed-1414c372e1ce\", \"phone\": \"+16502469293\", \"recorded_at\": \"2016-03-09T07:13:05.026316Z\"}" \
     https://app.hypertrack.io/api/v1/gps/

Example response

{}

Bulk create GPS Logs

Create multiple GPS logs, by sending a list of GPS Log objects.

HTTP Request

POST https://app.hypertrack.io/api/v1/gps/bulk/

Returns

Empty response, to minimize response payload.

curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X POST \
     -d "[{\"driver_id\": \"41caa9f2-ad63-4a8b-98ed-1414c372e1ce\", \"phone\": \"+16502469293\", \"recorded_at\": \"2016-03-09T07:13:05.026316Z\"}]" \
     https://app.hypertrack.io/api/v1/gps/bulk/

Example response

{}

Retrieve a GPS Log

Retrieves a GPS Log object with the id.

HTTP Request

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

Returns

Returns a GPS Log object if a valid identifier was provided.

curl -H "Authorization: token YOUR_PK_TOKEN" \
     -X GET \
     https://app.hypertrack.io/api/v1/gps/06356307-355a-46a0-b435-73d4926f18b9/

Example response

{
  "id": "06356307-355a-46a0-b435-73d4926f18b9",
  "driver_id": "58ea38ee-fa3b-4f31-a551-2b0a937c6c3c",
  "location": {
    "type": "Point",
    "coordinates": [
      77.20267225995399,
      28.55390609244681
    ]
  },
  "location_accuracy": 10.0,
  "speed": 7.40999984741211,
  "bearing": 283.7109375,
  "altitude": 199.257446289062,
  "fetch_next_points": false,
  "recorded_at": "2016-10-20T14:47:25.996000Z",
  "created_at": "2016-10-20T15:05:11.628618Z",
  "modified_at": "2016-10-20T15:05:11.628664Z",
  "activities": null,
  "activity_confidence": null,
  "provider": null
}

List all filtered GPS Logs

GPS Log data from the device is filtered to remove noise and improve accuracy. This filtered list can be retrieve with this API. You can also specify parameters to query GPS Log objects of a particular driver or time period.

[info] Alternative approaches

  • If you are looking for location data of a Trip or a Task, use the time aware polyline on the Trip (or Task) object. The polyline compresses the location and timestamp data into a small string that is far easier to retrieve than a long list of GPS Log objects. Read more about Trip polylines here.
  • It is also possible to listen for location data updates by subscribing to a Apacha Kafka stream, instead of querying for location data periodically. Read more streaming here.

HTTP Request

GET https://app.hypertrack.io/api/v1/gps/

Returns

Returns a list of GPS Log objects.

Parameters

Parameter Required Description
page_size No Maximum number of objects to return, default is 50
driver_id No Filter GPS Log objects by driver
min_recorded_at No Filter objects by minimum device timestamp
max_recorded_at No Filter objects by maximum device timestamp
min_date No Filter objects by minimum created at date
max_date No Filter objects by maximum created at date
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -X GET \
     https://app.hypertrack.io/api/v1/gps/?page_size=1

Example response

{
  "count": 656816,
  "next": "https://app.hypertrack.io/api/v1/gps/?page=2",
  "previous": null,
  "results": [
    {
        "id": "06356307-355a-46a0-b435-73d4926f18b9",
        "driver_id": "58ea38ee-fa3b-4f31-a551-2b0a937c6c3c",
        "location": {
            "type": "Point",
            "coordinates": [
                77.20267225995399,
                28.55390609244681
            ]
        },
        "location_accuracy": 10.0,
        "speed": 7.40999984741211,
        "bearing": 283.7109375,
        "altitude": 199.257446289062,
        "fetch_next_points": false,
        "recorded_at": "2016-10-20T14:47:25.996000Z",
        "created_at": "2016-10-20T15:05:11.628618Z",
        "modified_at": "2016-10-20T15:05:11.628664Z",
        "activities": null,
        "activity_confidence": null,
        "provider": null
    }
  ]
}

results matching ""

    No results matching ""