Skip to content

Insurance Events

Info

This document is a work in progress.

Currently, Insurance events contain below event(s), still working in progress:

  • Insurance Events
    • Trip Score Event - Should be sent when a trip cycle ends which contains trip details and overall trip score

Insurance Events

Trip Score Event

Should be sent when a trip cycle ends which contains trip details and overall trip score

Key methods:

Method Details
setTripId(Stringtrip_id) Set current trip id, optional data field.
setStartTime(Double start_time) Set strip starts time in milliseconds, mandatory data field.
setEndTime(Long end_time) Set strip ends time in milliseconds, mandatory data field.
setOriginLat(Double origin_lat) Set latitude of the trip origin, mandatory data field.
setOriginLon(Double origin_lon) Set longitude of the trip origin, mandatory data field.
setDestLat(Double dest_lat) Set latitude of the trip destination, mandatory data field.
setDestLon(Double dest_lon) Set longitude of the trip destination, mandatory data field.
setTripScore(Double trip_score) Set overall trip score, mandatory data field.
setTripScoreDetails(DrivingScoreItem[] trip_score_details) The list of sub driving score, optional data field.
setTripDetails(String trip_details) The trip details in json for generating the score, optional data field.

DrivingScoreItem

Key methods

Method Details
setName(String name) Set the item name, mandatory data field.
setValue(Double value) Set the item value, mandatory data field.

Sample code

1
2
3
4
5
6
7
SendEventRequest.Builder builder = dataCollectorClient.sendEventRequest();
SendEventResponse response = builder
              .setEvent(TripScoreEvent.builder()
                    .setTripScore(77.77).setStartTime(1597029160173L).setEndTime(1597029160173L)
                    .setOriginLat(37.123456).setOriginLon(122.123456)
                    .setDestLat(37.123456).setDestLon(122.123456)
                    .build()).execute();
1
2
3
4
5
6
7
var builder = dataCollectorClient.sendEventRequest();
var response = builder
          .setEvent(TripScoreEvent.builder()
          .setTripScore(77.77).setStartTime(1597029160173L).setEndTime(1597029160173L)
          .setOriginLat(37.123456).setOriginLon(122.123456)
          .setDestLat(37.123456).setDestLon(122.123456)
          .build()).execute()

Response example

1
2
3
4
5
{
  "code": "SUCCESS",
  "message": "SendEventResponse Success",
  "response_time": 1
}