agustinsantiago February 2016

Getting information on ride requests in sandbox mode

Using Uber's API, I managed to make a trip request, and then change it's status to accepted via the PUT command described in the docs.

However, if afterwards I make a GET request to fetch ride's attributes, I get status = accepted, but driver, eta, location and vehicle are null. Thus, I can't test that the whole flow works.

Am I missing something?

Answers


Mnemonic Flow February 2016

According to the /v1/requests/{request_id} endpoint documentation

Note: The following fields are populated only when a trip is active:

driver
vehicle
pickup
destination

The meaning of the "accepted" status is:

accepted The Request has been accepted by a driver and is "en route" to the start location (i.e. start_latitude and start_longitude).

I think by "trip is active" they mean the request status needs to be in_progress

in_progress The Request is "en route" from the start location to the end location.

Try to change the status of the request to in_progress using the PUT /v1/sandbox/requests/{request_id} sandbox endpoint.
After this you should be able to get access to the driver, vehicle, pickup and destination fields.


Richard Artoul February 2016

Actually, once the trip in sandbox mode is set to status "Accepted" you should be able to see all those attributes. I just tested this myself and it worked fine.

The flow I followed was:

1) POST to https://sandbox-api.uber.com/v1/requests (with the proper params and auth headers) to create a sandbox trip

2) PUT to https://sandbox-api.uber.com/v1/sandbox/requests/{trip_UUID from step 1) with JSON body: {"status": "accepted"}

3) GET https://sandbox-api.uber.com/v1/requests/current OR GET https://sandbox-api.uber.com/v1/requests/{trip_UUID from step 1}

Could you provide some more details on the exact flow you followed?

Post Status

Asked in February 2016
Viewed 3,820 times
Voted 12
Answered 2 times

Search




Leave an answer