User Feedback API
The userFeedback
API collects feedback from the user, clarifying their status as driver or passenger on a trip. This input impacts the user’s Zendrive Score. As a measure to prevent abuse of this mechanic, Zendrive also provides a report on user feedback which can be manually verified.
User Feedback and Zendrive Score
On occasion, Zendrive’s drive category detection might not be accurate and a user may want to manually indicate whether they were driving their vehicle or were a passenger.
To facilitate this optional user feedback, Zendrive provides the addDriveCategory method, which can be implemented to add a drive category to a trip.
The method accepts 2 parameters:
driveId
A unique ID to identify the trip, as returned at the end of drive in DriveInfo.driveId
.
driveCategory
The category that best indicates the type of trip, such as CAR
, CAR_DRIVER
, BICYCLE
, and INVALID
. See DriveCategory for a full list of acceptable values.
We recommend that you call this method after a trip analysis is done. Call this method in the onDriveAnalyzed
event, and present a limited number of user options based on your use case. In this implementation, the user will receive a notification at the end of the trip to provide feedback. Upon receiving user feedback, the Zendrive score will be updated when the trip data is uploaded (usually a few minutes with network availability).
Feedback Audit
The feedback system could be abused by users to increase their score, or to reduce driver miles. In order to prevent abuse of the feedback mechanism, Zendrive provides a user feedback audit report that can be manually verified.
Before you Begin
Ensure you have implemented the user feedback method in your application.
Allow users to provide trip feedback. Their user score is adjusted within a few minutes.
Request a Feedback Report
Use the report
API with the following parameters to request an audit report. The audit report is emailed to the ID provided in the notification_channel_id
parameter.
Request Parameters
start_date
required
Start of date range for audit report (within last 6 months)
end_date
required
End of date range for audit report (within last 6 months)
notification_channel
required
Channel using which to send the report. In this case, only email is supported.
notification_channel_id
required
Email address to send generated report to.
report_type
required
Type of the report. In this case: trip_feedback_details
ids
optional
Comma separated list of driver_ids
to filter the feedback report. Only feedback for trips from these ids will be returned in the response. If empty, no filter is applied and all qualifying feedback points are returned in the response.
Sample Request
import requests
url = "https://api.zendrive.com/v3/report"
querystring = {"start_date":"2020-07-28","end_date":"2020-08-01","notification_channel ":"email","notification_channel_id":"<email_id>","report_type":"trip_feedback_details","ids":"<comma_separated_ids>","notification_channel":"email"}
headers = {
'Authorization': "APIKEY <api_key>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
Response Parameters
When you make a request for a report, a CSV file is generated and sent to the provided email ID. The file contains the following columns. Each row of data corresponds to a single instance of trip feedback received from the customer app.
Trip Id
Unique ID assigned by Zendrive for each trip.
Driver Id
User ID of the driver who has given feedback.
Driver Alias
Alias provided by the app for the driver_id.
Driver Attributes
Custom attributes provided by the app for the driver_id in a JSON string.
Trip Feedback Time
Feedback time of trip in ISO format.
Is False Trip
Feedback from user indicated that the recorded trip was not valid
Feedback User Mode
Feedback from the user that it was a driver, passenger, or none.
Feedback Drive Type
Classifies the Feedback as driving or non_driving.
Start Time
Start time of trip in ISO format.
End Time
End time of trip in ISO format
Is Auto Trip
Auto trip or manual trip (true/false)
Distance (in Km)
Distance traversed in the trip in kilometers.
Drive Time (in Hours)
Drive time of the trip in hours
Timezone
Timezone in which the trip was made.
Tracking Id
Tracking ID of a manual trip
Hard Brake Rating
The hard brake event rating of the trip if this was originally recorded as a drive.
Rapid Acceleration Rating
The acceleration event rating of the trip if this was originally recorded as a drive.
Phone Use Rating
The phone use event rating of the trip if this was originally recorded as a drive.
Hard Turn Rating
The hard turn event rating of the trip if this was originally recorded as a drive.
Overspeeding Rating
The over speeding event rating of the trip if this was originally recorded as a drive.
Zendrive Score
The trip score if this was originally recorded as a drive.
Device Model
Model of device where trip was recorded.
OS
Values: Android
, iOS
OS Version
OS version on the device when the trip is recorded.
Was this helpful?