uploadTripFeedback API Endpoint
The uploadTripFeedback
endpoint will be used to upload trip feedback from the customer application to Zendrive's backend.
POST
URL: https://api.zendrive.com/v1/driver/<user_id>/trip/<trip_id>/feedback
Query Parameters
user_id
String
The user id of the user whose trip feedback is being uploaded.
trip_id
String
The unique Id of the trip.
Headers
Authorization*
API KEY <APIKEY>
{
// Response
}
Request Payload
{
"trip_type": <new trip type, string> # valid values at the end
"timestamp": <feedback timestamp which is epoch in milliseconds
UTC, integer>
}
Sample Payload
{
"trip_type": "car_passenger",
"timestamp": 1658909624001
}
Trip-type Valid Values:
The following values are valid for trip_type:
car
, car_driver
, car_passenger
, train
, bus
, bicycle
, foot
, motorcycle
, transit
, flight
, invalid
, not_car
, other
Corner Cases and Scenarios
The following are the corner cases and scenarios that can come up during the Upload Trip Feedback API execution:
If the Zendrive backend receives duplicate feedback for a trip, the first feedback will be retained and the second will be discarded.
If the Zendrive backend receives new feedback with the timestamp being greater than or equal to the previous feedback, the trip will be rescored.
If the Zendrive backend receives old feedback, where the timestamp is shown to be lesser than in the previous feedback, then the trip will not be rescored. This is due to the reason that the older feedback arrives after the current feedback is received.
If trip feedback doesn’t change trip category, rescoring will not happen. For example, if Zendrive SDK detects that the vehicle type is 'bicycle', and the user input was 'bus', then the Zendrive backend will not send a webhook for user rescoring. This is because neither the vehicle type as per the feedback nor the user's input don't have any impact on the user’s score.
Was this helpful?