associateVehicles API Endpoint

The associateVehicles API endpoint returns list of all the vehicles under a single fleet.

Refer to Zendrive Server APIs for an understanding of how Zendrive server APIs are organized.

API Details

associateVehicles

GET https://api.zendrive.com/v1/vehicles

Returns a list of vehicles for a given fleet.

Headers

Name
Type
Description

Authorization*

String

API KEY <APIKEY>

{
  "vehicles": [
    {
      "vehicle_id": "123456789",
      "info": {
        "trip_count": 12,
        "duration_seconds": 10087.250999999998,
        "distance_km": 93.903,
        "attributes": {
          "model": "A4",
          "make": "Audi",
          "model_year": 2022,
          "color": "white",
          "vin": "vin_string",
          "nickname": "nickname_string",
          "pairing": "bluetooth"
        }
      },
      "driving_behavior": {
        "event_rating": {
          "hard_brake_rating": 3,
          "hard_turn_rating": 5,
          "rapid_acceleration_rating": 5,
          "phone_use_rating": 4,
          "overspeeding_rating": 5
        },
        "score": {
          "zendrive_score": 88
        }
      }
    }
  ],
  "start_date": "2022-01-01",
  "end_date": "2022-01-31",
  "total_count": 8,
  "next_offset": 2
}

Sample URL

https://api.zendrive.com/v1/vehicles?order_by=distance_km&order_type=desc&limit=2&start_date=2022-01-01&end_date=2022-01-20" -H 'Authorization: APIKEY <api_key>'

This API uses the following Date Range, Pagination, and Sorting parameters:

  • To specify date range:start_date, end_date

  • To search for specific vehicle_ids:vehicle_ids

  • For sorting, based on the following order_by, order_type:

    • trip_count, duration_seconds, distance_km, zendrive_score, and one of

    • asc, desc

  • For pagination: limit, offset

To Query Subaccount Use Case

To query subaccount, execute the following link using the subaccount_id:

Response Fields

Driving Behavior Fields
Description

driving_behavior.event_rating

An array containing a list of driving events that happened during the trip. Events represent granular details of Zendrive scores.

driving_behavior.event_rating.hard_brake_rating

Rating assigned to the hard brakes applied during the trip.

driving_behavior.event_rating.hard_turn_rating

Rating assigned to the hard turn events that occurred during the trip.

driving_behavior.event_rating.overspeeding_rating

Rating assigned to the over-speeding events that occurred during the trip.

driving_behavior.event_rating.phone_use_rating

Rating assigned to phone usage that occurred during the trip.

driving_behavior.event_rating.rapid_acceleration_rating

Rating assigned to the rapid acceleration events that occurred during the trip.

driving_behavior.score.zendrive_score

The Zendrive score assigned to the overall driving behavior during the trip.

Sample Response

{
  "vehicles": [
    {
      "vehicle_id": "123456789",
      "info": {
        "trip_count": 12,
        "duration_seconds": 10087.250999999998,
        "distance_km": 93.903,
        "attributes": {
          "model": "A4",
          "make": "Audi",
          "model_year": 2022,
          "color": "white",
          "vin": "vin_string",
          "nickname": "nickname_string",
          "pairing": "bluetooth"
        }
      },
      "driving_behavior": {
        "event_rating": {
          "hard_brake_rating": 3,
          "hard_turn_rating": 5,
          "rapid_acceleration_rating": 5,
          "phone_use_rating": 4,
          "overspeeding_rating": 5
        },
        "score": {
          "zendrive_score": 88
        }
      }
    }
  ],
  "start_date": "2022-01-01",
  "end_date": "2022-01-31",
  "total_count": 8,
  "next_offset": 2
}

Events represent granular details of Zendrive, such as:

  • Hard brake

  • Hard turn

  • Overspeeding

  • Phone use

  • Acceleration

Was this helpful?