We enable users to register their own callback URLs to receive notifications related to status change of a booking. It is recommended to use webhooks along with the Track Ride API to get the status updates of bookings, thereby reducing the poll frequency. You can register the same in your Ola developers account.
A webhook URL is a REST endpoint hosted in a publicly accessible server controlled by you, and should mandatorily satisfy the below requirements:
There will be a one-time validation of the webhook with the below request:
{
"request_type" : "WEBHOOK_URL_VALIDATION"
}
The response from the endpoint for all the requests should conform to the following format:
{
"success": "true",
"name": <company_name> //should match exactly with name registered in your account
}
The webhooks URL is expected to return a response as explained above. If due to some reason Ola cannot reach the webhooks URL specified, either due to network issues or application issues at your end or if the endpoint responds with a HTTP error code 500, Ola will try to retry to send the request 7 more times.
The following state changes are notified via webhooks
{
"timestamp": "2016-08-23T18:25:24.090+05:30",
"booking_id": "CRN123456789",
"booking_status": "CALL_DRIVER",
"driver_name": "Driver Name",
"driver_number": "9999999999",
"cab_type": "Mini",
"cab_number": "KA12345",
"car_model": "Tata Indica",
"car_color": "White"
}
{
"timestamp":"2017-12-01T14:09:57,000 +0530",
"booking_id":"CRN123456789",
"driver_lat":22.5187317,
"driver_lng":88.3654213,
"booking_status":"CLIENT_LOCATED"
}
{
"timestamp":"2017-12-01T14:07:28.527+05:30",
"booking_id":"CRN123456789",
"booking_status":"IN_PROGRESS"
}
{
"timestamp":"2017-12-01T14:10:03.845+05:30",
"booking_id":"CRN123456789",
"booking_status":"COMPLETED",
"trip_info":{
"amount":264.0,
"payable_amount":264.0,
"distance":{
"value":14.8,
"unit":"KM"
},
"wait_time":{
"value":0.0,
"unit":"MINUTE"
},
"discount":0.0,
"advance":0.0,
"round_off_value":-0.17
},
"fare_breakup":[
{
"display_text":"Base fare",
"value":70.0
},
{
"display_text":"Distance fare for next 14.8 km",
"value":118.4
},
{
"display_text":"Ride time fare",
"value":52.0
},
{
"display_text":"Total tax",
"value":18.62
}
],
"driver_name":"Name of the driver",
"license_no":"MX04XX0000"
}
{
"timestamp":"2017-12-01T14:09:03.231+05:30",
"booking_id":"CRN123456789",
"booking_status":"BOOKING_CANCELLED",
"cancellation_reason":"customer_request"
}
{
"timestamp":"2017-12-05T12:55:45.909+05:30",
"booking_id":"CRN123456789",
"booking_status":"ALLOTMENT_FAILED",
"cancellation_reason":"stock_out"
}