[API] Search Vehicles
The Search Vehicles API is specifically designed for Rental suppliers to enhance their operations by enabling an efficient search of vehicles within their organization.
¶ Use case
This Search Vehicles API allows suppliers to perform searches based on criteria such as the vehicle identification number (VIN) and license plate, with data refreshness time being less than 2 minutes. This functionality can be crucial for tasks like tracking vehicle status, compliance with regulations, and assigning vehicles to drivers within the organization.
¶ Support for Hierarchical Data
The Search Vehicles API automatically operates within the hierarchical structure of the organization linked to the developer’s account at the time of setup.
¶ Supported supplier types
Rentals
¶ Scopes
vehicle_suppliers.vehicles.read
¶ Resource
/v1/vehicle-suppliers/vehicles/search
¶ HTTP Method
POST
¶ Access Method
¶ Example Request
curl -X POST "https://api.uber.com/v1/vehicle-suppliers/vehicles/search" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"filters": {
"vin": "4S3BJ6321N6900903",
"license_plate": "TEST-ABC"
},
"fields": "_all_"
}'
¶ Request Body Parameters
Name | Type | Description |
---|---|---|
filters |
object | Search filters with (multiple filters can be specified). |
filters.vin (optional) |
string | VIN of the vehicle (exact match). |
filters.license_plate (optional) |
string | License plate of the vehicle (partial match). |
fields (optional) |
string | If set to _all_ , the response includes the vehicle compliance info and vehicle assignment info. |
¶ Example Response
Status-code: 200
{
"vehicles": [
{
"id": "<vehicle_id>",
"owner_id": "<owner_id>",
"make": "Honda",
"model": "Civic",
"year": 2020,
"vin": "4S3BJ6321N6900903",
"license_plate": "TEST-ABC",
"color_hex_code": "FFFFFF",
"color_name": "white",
"last_updated": 1584043576000,
"compliance": {
"status": "INACTIVE",
"documents": [
{
"type_name": "Vehicle Insurance",
"type_id": "<type_id>",
"status": "REJECTED",
"status_reason_name": "wrong_document"
},
{
"type_name": "Vehicle Registration",
"type_id": "<type_id>",
"status": "MISSING"
},
{
"type_name": "Vehicle Inspection",
"type_id": "<type_id>",
"status": "MISSING"
}
]
},
"assignments": [
{
"driver_id": "<driver_id>"
}
]
}
]
}
¶ Response Body Parameters
Name | Type | Description |
---|---|---|
vehicles |
object array | List of Vehicle objects |
Vehicle
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 |
Rate limit
- The rate limit for this endpoint is 7200 requests per hour (RPH)
¶ Endpoint Specific Errors
Http Status Code | Code | Message |
---|---|---|
400 |
bad_request | The request parameters are invalid |
401 |
unauthorized | Invalid OAuth 2.0 credentials provided |
429 |
rate_limited | Number of requests exceeds allowed limit |
500 |
internal_server_error | Internal server error |
503 |
service_unavailable | Service unavailable |
Notes
- In the Search Vehicles API, by setting the fields parameter to all, you can retrieve comprehensive details in the response, including vehicle compliance and assignment information. If not set to all, you can customize the response to include only the necessary data fields, optimizing response efficiency.