Skip to content

Trips

Access vehicle trip history details.

Get List of Trips

Get a list of trips for the account. A trip is the logical grouping of all points that are recorded from the time the vehicle’s engine is started to the time the engine is turned off.

GET

http
https://api.zubiecar.com/api/v2/zinc/trips

Query Parameters

PropertyTypeDescription
user_keystringFilter results to visits to a single driver.
vehicle_keystringFilter results to a single vehicle.
started_afterstringFilter results to only include trips that started on or after this timestamp. ISO8601 format (if no offset provided, assumed UTC).
started_beforestringFilter results to only include trips that started on or before this timestamp. ISO8601 format (if no offset provided, assumed UTC).
tag_keysArray of stringsRestrict results to include only vehicles with these tag keys. Multiple tag values may be provided. Takes precedence over tags query param if both provided.
cursorstringThe cursor string used for pagination, signifying the object ID where to start the results.
sizestringThe number of results to return per call. Defaults to 10 if not provided.
expandArray of stringsDefault: [user, vehicle, tags] Items Enum: user vehicle tags Optional list of expanded properties to include in results.
Sample response 200
json
{
  "trips": [
    {
      "key": "SampleKey",
      "device_key": "SampleKey",
      "account_key": "SampleKey",
      "user": {
        "key": "SampleKey",
        "first_name": "Bob",
        "last_name": "Roberts"
      },
      "user_key": "SampleKey",
      "vehicle": {
        "key": "SampleKey",
        "nickname": "Van 123"
      },
      "vehicle_key": "SampleKey",
      "start_point": {
        "point": {
          "lat": 40.74778,
          "lon": -73.99889
        },
        "timestamp": "2018-02-20T12:00:00+00:00",
        "odometer": 21923,
        "fuel_level": 21923,
        "place": {
          "key": "SampleKey",
          "name": "Headquarters"
        },
        "address": {
          "street": null,
          "city": null,
          "state": null,
          "zipcode": null
        }
      },
      "end_point": {
        "point": {
          "lat": 40.74778,
          "lon": -73.99889
        },
        "timestamp": "2018-02-20T12:00:00+00:00",
        "odometer": 21923,
        "fuel_level": 21923,
        "place": {
          "key": "SampleKey",
          "name": "Headquarters"
        },
        "address": {
          "street": null,
          "city": null,
          "state": null,
          "zipcode": null
        }
      },
      "duration_seconds": 2818,
      "idle_seconds": 241,
      "obd_distance": 2.4,
      "gps_distance": 2.5,
      "distance_um": "mi",
      "top_speed": 80,
      "speed_um": "mph",
      "hard_brake_count": 0,
      "hard_accel_count": 0,
      "points_city_count": 80,
      "points_hwy_count": 32,
      "speeding_city_minor_count": 8,
      "speeding_city_major_count": 0,
      "speeding_hwy_minor_count": 12,
      "speeding_hwy_major_count": 6,
      "tags": [
        {
          "value": "Personal",
          "key": "SampleKey",
          "color": "#CCCCCC"
        }
      ],
      "fuel_cost": "0.39",
      "fuel_cost_currency_code": "USD",
      "fuel_cost_currency_symbol": "$",
      "fuel_ppg": "2.06",
      "fuel_type": "regular",
      "fuel_consumed": 0.25,
      "fuel_consumed_um": "gal",
      "trip_segments": 1,
      "static_map_url": "https://zubiecar.com/maps/static/Key",
      "encoded_polyline": "SamplePolyline",
      "range_remaining": 16.0,
      "range_remaining_um": "mi",
    }
  ]
}

Get One Trip

Get the details for a single trip.

GET

http
https://api.zubiecar.com/api/v2/zinc/trip/{trip_key}

Path Parameters

PropertyTypeDescription
trip_keyrequiredUnique trip key.
Sample response 200
json
{
  "key": "SampleKey",
  "device_key": "SampleKey",
  "account_key": "SampleKey",
  "user": {
    "key": "SampleKey",
    "first_name": "Bob",
    "last_name": "Roberts"
  },
  "user_key": "SampleKey",
  "vehicle": {
    "key": "SampleKey",
    "nickname": "Van 123"
  },
  "vehicle_key": "SampleKey",
  "start_point": {
    "point": {
      "lat": 40.74778,
      "lon": -73.99889
    },
    "timestamp": "2018-02-20T12:00:00+00:00",
    "odometer": 21923,
    "fuel_level": 21923,
    "place": {
      "key": "SampleKey",
      "name": "Headquarters"
    },
    "address": {
      "street": null,
      "city": null,
      "state": null,
      "zipcode": null
    }
  },
  "end_point": {
    "point": {
      "lat": 40.74778,
      "lon": -73.99889
    },
    "timestamp": "2018-02-20T12:00:00+00:00",
    "odometer": 21923,
    "fuel_level": 21923,
    "place": {
      "key": "SampleKey",
      "name": "Headquarters"
    },
    "address": {
      "street": null,
      "city": null,
      "state": null,
      "zipcode": null
    }
  },
  "duration_seconds": 2818,
  "idle_seconds": 241,
  "obd_distance": 2.4,
  "gps_distance": 2.5,
  "distance_um": "mi",
  "top_speed": 80,
  "speed_um": "mph",
  "hard_brake_count": 0,
  "hard_accel_count": 0,
  "points_city_count": 80,
  "points_hwy_count": 32,
  "speeding_city_minor_count": 8,
  "speeding_city_major_count": 0,
  "speeding_hwy_minor_count": 12,
  "speeding_hwy_major_count": 6,
  "tags": [
    {
      "value": "Personal",
      "key": "SampleKey",
      "color": "#CCCCCC"
    }
  ],
  "fuel_cost": "0.39",
  "fuel_cost_currency_code": "USD",
  "fuel_cost_currency_symbol": "$",
  "fuel_ppg": "2.06",
  "fuel_type": "regular",
  "fuel_consumed": 0.25,
  "fuel_consumed_um": "gal",
  "trip_segments": 1,
  "static_map_url": "https://zubiecar.com/maps/static/Key",
  "encoded_polyline": "SamplePolyline",
  "range_remaining": 16.0,
  "range_remaining_um": "mi",
}

Update Trip

Modify the tags or driver associated with a trip.

POST

http
https://api.zubiecar.com/api/v2/zinc/trip/{trip_key}

Path Parameters

PropertyTypeDescription
trip_keyrequiredUnique trip key.

Request Body Schema

PropertyTypeDescription
user_keystringChange the driver associated with this trip. New user must be in an account with access to trip.
tag_keysArray of stringsList of tags keys to tag the trip with.
Sample request body
json
{
  "user_key": "SampleKey",
  "tag_keys": [
    "TagKey1",
    "TagKey2"
  ]
}
Sample response 200
json
{
  "key": "SampleKey",
  "device_key": "SampleKey",
  "account_key": "SampleKey",
  "user": {
    "key": "SampleKey",
    "first_name": "Bob",
    "last_name": "Roberts"
  },
  "user_key": "SampleKey",
  "vehicle": {
    "key": "SampleKey",
    "nickname": "Van 123"
  },
  "vehicle_key": "SampleKey",
  "start_point": {
    "point": {
      "lat": 40.74778,
      "lon": -73.99889
    },
    "timestamp": "2018-02-20T12:00:00+00:00",
    "odometer": 21923,
    "fuel_level": 21923,
    "place": {
      "key": "SampleKey",
      "name": "Headquarters"
    },
    "address": {
      "street": null,
      "city": null,
      "state": null,
      "zipcode": null
    }
  },
  "end_point": {
    "point": {
      "lat": 40.74778,
      "lon": -73.99889
    },
    "timestamp": "2018-02-20T12:00:00+00:00",
    "odometer": 21923,
    "fuel_level": 21923,
    "place": {
      "key": "SampleKey",
      "name": "Headquarters"
    },
    "address": {
      "street": null,
      "city": null,
      "state": null,
      "zipcode": null
    }
  },
  "duration_seconds": 2818,
  "idle_seconds": 241,
  "obd_distance": 2.4,
  "gps_distance": 2.5,
  "distance_um": "mi",
  "top_speed": 80,
  "speed_um": "mph",
  "hard_brake_count": 0,
  "hard_accel_count": 0,
  "points_city_count": 80,
  "points_hwy_count": 32,
  "speeding_city_minor_count": 8,
  "speeding_city_major_count": 0,
  "speeding_hwy_minor_count": 12,
  "speeding_hwy_major_count": 6,
  "tags": [
    {
      "value": "Personal",
      "key": "SampleKey",
      "color": "#CCCCCC"
    }
  ],
  "fuel_cost": "0.39",
  "fuel_cost_currency_code": "USD",
  "fuel_cost_currency_symbol": "$",
  "fuel_ppg": "2.06",
  "fuel_type": "regular",
  "fuel_consumed": 0.25,
  "fuel_consumed_um": "gal",
  "trip_segments": 1,
  "static_map_url": "https://zubiecar.com/maps/static/Key",
  "encoded_polyline": "SamplePolyline"
}

Get Trip Points

Get the detailed GPS points and event details for a given trip.

GET

http
https://api.zubiecar.com/api/v2/zinc/trip/{trip_key}/points

Path Parameters

PropertyTypeDescription
trip_keyrequiredUnique trip key.

Query Parameters

PropertyTypeDescription
cursorstringThe cursor string used for pagination, signifying the object ID where to start the results.
sizestringThe number of results to return per call. Defaults to 200 if not provided.
Sample response 200
json
{
  "trip_points": [
    {
      "point": {
        "lat": 40.74778,
        "lon": -73.99889
      },
      "events": [
        [
          "hard-brake"
        ]
      ],
      "speed": 32,
      "gps_speed": 33,
      "speed_limit_delta": 7,
      "acceleration": 7.1,
      "acceleration_um": "mph/s",
      "heading": 181,
      "rpm": 2950,
      "timestamp": "2018-02-20T12:00:00"
    }
  ]
}