6. Change Driver State - Cancel
POST {{sandbox_base_url}}/v1/guests/sandbox/driver-state
Update Sandbox Run Driver State
https://developer.uber.com/docs/guest-rides/references/api/v1/guest-sandbox-driver_state-post
Use this endpoint to update status of the driver to make the driver GO online or accept a ride.
As you can observe in request payload, a specific driver based on driver ID status is changed for a specific run using it's run ID.
Important: This action needs to be taken immediately after a trip is created.
Driver states:
| ACCEPT | Request a driver to accept the offer. The driver needs to be near the pickup location and needs to be offered the trip. It is recommended to ACCEPT the trip within 15 seconds of creating a trip.
| ARRIVED | Request a driver to arrive to pickup location.
| BEGIN_TRIP | Request a driver to begin the trip. |
| DROPOFF | Request a driver to arrive to dropoff location.
| CANCEL | Request a driver to cancel the trip after they have changed state to ACCEPT or ARRIVED.
| GOONLINE | Request a driver to go online. On run creation, the driver is automatically put in this state. After 5 minutes, the driver may automatically GOOFFLINE and will have to be put back to the online state to accept trips.
| GO_OFFLINE | Request a driver to go offline. This will mean that the driver will not be offered any trips. |
Request Body
{"run_id"=>"{{run_id}}", "driver_id"=>"{{driver_id}}", "driver_state"=>"CANCEL"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |