我正在尝试在沙箱环境中集成出租车可用性和估算的Ola api。根据ola文档,他们在印度班加罗尔的KR Puram创建了沙箱环境的虚拟出租车(Lat:13.0040167,Lng:77.6877765)和 Orion Mall,班加罗尔,印度(Lat:13.0107881,Lng:77.5527122)。但是当我用他们的请求url和其他标题数据发出请求时 (x-app-token,授权),它没有回复可用的cab数据。我正在使用邮递员。请使用一些解决方案恢复。
请求网址
回复
{
"categories": [
{
"id": "micro",
"display_name": "Micro",
"currency": "INR",
"distance_unit": "kilometer",
"time_unit": "minute",
"eta": -1,
"distance": -1,
"ride_later_enabled": "true",
"ride_later_allowed": true,
"ride_now_allowed": false,
"image": "http://d1foexe15giopy.cloudfront.net/micro.png",
"cancellation_policy": {
"cancellation_charge": 25,
"currency": "INR",
"cancellation_charge_applies_after_time": 5,
"time_unit": "minute"
},
"fare_breakup": [
{
"type": "flat_rate",
"minimum_distance": 2,
"minimum_time": 1,
"base_fare": "60.0",
"minimum_fare": "0.0",
"cost_per_distance": "9.0",
"waiting_cost_per_minute": 0,
"ride_cost_per_minute": "1.5",
"surcharge": [],
"rates_lower_than_usual": false,
"rates_higher_than_usual": true
},
{
"type": "flat_rate",
"minimum_distance": 0,
"minimum_time": 0,
"base_fare": "90.0",
"minimum_fare": "225.0",
"cost_per_distance": "9.0",
"waiting_cost_per_minute": 0,
"ride_cost_per_minute": "1.5",
"surcharge": [],
"rates_lower_than_usual": false,
"rates_higher_than_usual": true
},
{
"type": "flat_rate",
"minimum_distance": 0,
"minimum_time": 0,
"base_fare": "90.0",
"minimum_fare": "225.0",
"cost_per_distance": "10.5",
"waiting_cost_per_minute": 0,
"ride_cost_per_minute": "1.5",
"surcharge": [],
"rates_lower_than_usual": false,
"rates_higher_than_usual": true
},
{
"type": "flat_rate",
"minimum_distance": 0,
"minimum_time": 0,
"base_fare": "90.0",
"minimum_fare": "225.0",
"cost_per_distance": "9.0",
"waiting_cost_per_minute": 0,
"ride_cost_per_minute": "3.0",
"surcharge": [],
"rates_lower_than_usual": false,
"rates_higher_than_usual": true
}
]
}
],
"ride_estimate": [
{
"category": "micro",
"distance": 21.94,
"travel_time_in_minutes": 50,
"amount_min": 323,
"amount_max": 340,
"discounts": {
"discount_type": "discount",
"discount_code": "RANDOM",
"discount_mode": "AUTO",
"discount": 5,
"cashback": 0
}
}
],
"previous_cancellation_charges": []
}
预期响应应包含如下的cab可用性数据:(参见ola文档)
"all_cabs": [{ // Current locations of nearby cabs
"lat": 12.9543501,
"lng": 77.5438193,
"id":"e0e7ba15f7249207c1d77ec07c1c06",
"bearing":534,
"accuracy":15
},
{
"lat": 12.9561008,
"lng": 77.5464725,
"id":"15f7249207c1d77e9207c1c0601d6c9c",
"bearing":135,
"accuracy":10
}]
}],