GET /partners/trips
¶ Trip History
The Trip History endpoint returns an array of trips for the authenticated driver.
The trips
array in the response will have a maximum length based on the limit
parameter. The response value count
may exceed limit
, therefore subsequent API requests may be necessary.
¶ Resource
GET /v1/partners/trips
¶ Authorization
OAuth 2.0 bearer token with the partner.trips
scope.
¶ Query Parameters
Name | Type | Description |
---|---|---|
offset (optional) |
integer |
Offset the list of returned results by this amount. Default is zero. |
limit (optional) |
integer |
Number of items to retrieve per page. Default is 10, maximum is 50. |
from_time (optional) |
integer |
Unix timestamp of the start time to query. Queries starting from the first trip if omitted. |
to_time (optional) |
integer |
Unix timestamp of the end time to query. Queries up to the last trip if omitted. |
¶ Example Request
curl "https://api.uber.com/v1/partners/trips" \
-H "Authorization: Bearer <TOKEN>"
¶ Response
Status-Code: 200 OK
{
"count": 1200,
"limit": 1,
"trips": [
{
"fare": 6.2,
"dropoff": {
"timestamp": 1502844378
},
"vehicle_id": "0082b54a-6a5e-4f6b-b999-b0649f286381",
"distance": 0.37,
"start_city": {
"latitude": 38.3498,
"display_name": "Charleston, WV",
"longitude": -81.6326
},
"status_changes": [
{
"status": "accepted",
"timestamp": 1502843899
},
{
"status": "driver_arrived",
"timestamp": 1502843900
},
{
"status": "trip_began",
"timestamp": 1502843903
},
{
"status": "completed",
"timestamp": 1502844378
}
],
"surge_multiplier": 1,
"pickup": {
"timestamp": 1502843903
},
"driver_id": "8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==",
"status": "completed",
"duration": 475,
"trip_id": "b5613b6a-fe74-4704-a637-50f8d51a8bb1",
"currency_code": "USD"
}
],
"offset": 0
}
Name | Type | Description |
---|---|---|
offset |
integer |
Position in pagination. |
limit |
integer |
Number of items to retrieve (50 max). |
count |
integer |
Total number of items available from the request. |
trips |
array |
Array of trips for the given driver. |
trips[].trip_id |
string |
Unique identifier of the trip. |
trips[].vehicle_id |
string |
Unique identifier of the trip’s vehicle. |
trips[].driver_id |
string |
Unique identifier of the trip’s driver. |
trips[].pickup.timestamp |
integer |
Unix timestamp of the trip’s pickup time. Can be null for canceled trips. |
trips[].drop_off.timestamp |
integer |
Unix timestamp of the trip’s drop off time. Can be null for canceled |
trips[].fare |
int |
Trip’s fare. |
trips[].currency_code |
string |
ISO 4217 currency code of the payment. |
trips[].surge_multiplier |
int |
Trip’s surge multiplier. Surge was active if surge_multiplier is greater than 1. |
trips[].distance |
float |
Trip’s distance (in miles). Can be null for canceled trips. |
trips[].duration |
int |
Trip’s duration (in seconds). |
trips[].start_city |
object |
Trip’s starting city. |
trips[].start_city.latitude |
float |
Latitude for trip’s starting city. |
trips[].start_city.longitude |
float |
Longitude for trip’s starting city. |
trips[].start_city.display_name |
string |
Display name for trip’s starting city. |
trips[].status |
string |
Trip’s most recent status. Can be rider_canceled, driver_canceled, completed . |
trips[].status_changes[] |
array |
List of changes in the trip’s status over its lifetime. |
trips[].status_changes[].status |
string |
Status the trip changed to. Can be accepted, driver_arrived, trip_began, completed, driver_canceled, rider_canceled . |
trips[].status_changes[].timestamp |
float |
Unix timestamp of the trip’s status change. |
¶ Error Responses
Error | Code | Description |
---|---|---|
401 |
unauthorized |
Invalid OAuth 2.0 credentials provided. |
409 |
forbidden |
The account used for authentication is not a driver account. |