沙盒上的 Uber 详细信息

Uber Details On sandbox

我在印度使用 uber-api`s 进行我的项目,因为我的项目仍处于开发阶段,我正在使用沙箱 environment.While 使用这个测试环境 uber 只是返回有关沙箱环境的以下详细信息 1.Allows 预订行程。 2.List 的 uber(Uberx,UberGo) 产品 3.Dummy收据。

沙盒环境中缺少的信息是 1.The 驱动程序详细信息 2.Vehicle 详情 3.Surge定价。

有什么方法可以让我在我的沙盒环境中获得所有这些详细信息?还是一个错误?

提前致谢。

Sandbox mode 传递对所有可用端点的调用。它本质上是 /requests/{request_id}/products/{product_id} 的例外(通过允许你使用 HTTP PUT):

At this time, most of the endpoints in the Sandbox environment are proxied straight to the production environment. The Request endpoint is the primary exception. It allows you to exercise the flow of ordering an Uber in your application without worrying about a real world trip being created. Additionally, you can simulate surging products or no drivers being available to ensure that your application handles these scenarios properly.

我不得不承认,我不熟悉 Uber API 印度特有的差异(很想知道),但总的来说,Uber API 允许您这样做:

1) GET /requests/current and GET /requests/{request_id}:Returns(除其他元素外)驾驶员和车辆详细信息作为 JSON 对象:

{ ... "driver": { "phone_number": "(555)555-5555", "rating": 5, "picture_url": "https:\/\/d1w2poirtb3as9.cloudfront.net\/img.jpeg", "name": "Bob" }, "vehicle":{ "make": "Bugatti", "model": "Veyron", "license_plate": "I<3Uber", "picture_url": "https:\/\/d1w2poirtb3as9.cloudfront.net\/car.jpeg" }, ... }

2) POST /requests:预订乘车时,服务器可以 return HTTP 409 状态代码 - 以防激增定价生效。它在 JSON 对象中提供以下详细信息:

"meta": { "surge_confirmation": { "href": "https:\/\/api.uber.com\/v1\/surge-confirmations\/e100a670", "surge_confirmation_id": "e100a670", "multiplier": 1.4, "expires_at": 1459191276 } }

要完成,您需要将用户重定向到确认 URL (meta.surge_confirmation.href)