6. Change Driver State - CANCEL

POST {{sandbox_base_url}}/v1/health/sandbox/driver-state

https://developer.uber.com/docs/health/references/api/v1/health-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 health 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

KeyDatatypeRequiredDescription
content-typestring
User-Agentstring