[API] Get Vehicles By Owner
Gets the vehicles owned by a vehicle supplier organization.
¶ Resource
/v1/vehicle-suppliers/vehicles
¶ HTTP Method
GET
¶ Access Method
¶ Required scopes
vehicle_suppliers.vehicles.read
¶ Example Request
curl GET "https://api.uber.com/v1/vehicle-suppliers/vehicles?org_id=<org_id>&page_token=<page_token>&page_size=2&fields=_all_" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json"
¶ Request Query Parameters
Name | Type | Description |
---|---|---|
org_id |
string | ID of the vehicle supplier organization that the vehicles belong to. |
page_token (optional) |
string | Pass in the next_page_token returned from previous call to get the next page. |
page_size (optional) |
integer | Maximum number of items to retrieve per page. Defaults to 5 if not provided. |
fields (optional) |
string | If set to _all_ , the response includes the vehicle compliance info and vehicle assignment info. |
Note: URL/URI encoding must be used for fields such as page_token
.
¶ Response Fields
Name | Type | Description |
---|---|---|
vehicles |
object array | List of Vehicle objects |
next_page_token |
string | Next page token |
Vehicle
object fields
Name | Type | Description |
---|---|---|
id |
string | Vehicle ID |
owner_id |
string | ID of the vehicle supplier that owns the vehicle |
make |
string | Make of the vehicle |
model |
string | Model of the vehicle |
year |
int | Make year of the vehicle |
vin |
string | Vin (chassis number) of the vehicle |
license_plate |
string | License plate ID of the vehicle |
color_hex_code |
string | Hex code of the vehicle color, e.g. FFFFFF for white color |
color_name |
string | Name of the vehicle color, e.g. White |
last_updated |
int | Last updated timestamp of the vehicle in milliseconds |
compliance |
object | Vehicle compliance info |
compliance.status |
string | Status of the vehicle: |
ACTIVE: vehicle is active | ||
INACTIVE: vehicle is not active | ||
compliance.documents |
object array | Vehicle documents |
compliance.documents[].type_name |
string | Type of document e.g. Vehicle Registration , Vehicle Insurance , Vehicle Inspection |
compliance.documents[].type_id |
string | ID of the document type |
compliance.documents[].status |
string | Status of the document: |
ACTIVE: document is approved and active | ||
MISSING: document is missing (not uploaded yet) | ||
PENDING: document is pending review from the document approver | ||
REJECTED: document was rejected by the document approver | ||
EXPIRED: document is expired | ||
compliance.documents[].status_reason_name |
string | Reason name for why the document is rejected |
compliance.documents[].expires_at |
int | Expiration timestamp of the document in milliseconds |
assignments |
object array | Vehicle assignments |
assignments[].driver_id |
string | ID of the driver that is assigned to the vehicle |
¶ Example Response
Status-code: 200
{
"vehicles": [
{
"id": "<vehicle_id>",
"owner_id": "<owner_id>",
"make": "Honda",
"model": "Civic",
"year": 2020,
"vin": "KMHDU4AD5AU136970",
"license_plate": "TEST-ABC",
"color_hex_code": "FFFFFF",
"color_name": "white",
"last_updated": 1584678070000,
"compliance": {
"status": "INACTIVE",
"documents": [
{
"type_name": "Vehicle Insurance",
"type_id": "<type_id>",
"status": "ACTIVE"
},
{
"type_name": "Vehicle Registration",
"type_id": "<type_id>",
"status": "PENDING"
},
{
"type_name": "Vehicle Inspection",
"type_id": "<type_id>",
"status": "MISSING"
}
]
},
"assignments": [
{
"driver_id": "<driver_id>"
}
]
},
{
"id": "<vehicle_id>",
"owner_id": "<owner_id>",
"make": "Toyota",
"model": "Sienna",
"year": 2020,
"vin": "4S3BJ6321N6900903",
"license_plate": "TEST-EFG",
"color_hex_code": "0000FF",
"color_name": "blue",
"last_updated": 1584043576000,
"compliance": {
"status": "INACTIVE",
"documents": [
{
"type_name": "Vehicle Insurance",
"type_id": "<type_id>",
"status": "REJECTED"
},
{
"type_name": "Vehicle Registration",
"type_id": "<type_id>",
"status": "MISSING"
},
{
"type_name": "Vehicle Inspection",
"type_id": "<type_id>",
"status": "MISSING"
}
]
},
"assignments": []
}
],
"next_page_token": "<next_page_token>"
}
¶ Endpoint Specific Errors
Http Status Code | Code | Message |
---|---|---|
400 |
bad_request | The request parameters are invalid |
401 |
unauthorized | Invalid OAuth 2.0 credentials provided |
404 |
organization_not_found | Supplier organization was not found or not authorized |
429 |
rate_limited | Number of requests exceeds allowed limit |
500 |
internal_server_error | Internal server error |
503 |
service_unavailable | Service unavailable |