Drivers
This section provides endpoints to retrieve driver-related information, including lists of drivers and specific driver details. These endpoints enable fleet managers to efficiently track and manage driver data with enhanced filters and pagination for improved usability.
List Drivers
Endpoint:
GET /drivers
Description:
Retrieve a paginated list of all drivers associated with your account. Use this endpoint to get an overview of the drivers connected to your fleet, with optional filters for more targeted queries.
Headers:
Header | Type | Description |
---|---|---|
x-api-key | String | API key to authenticate the request. Obtain from portal. |
Connection-Id | UUID | (Optional) Specifies a particular connection to query. |
Query Parameters:
Parameter | Type | Description |
---|---|---|
limit | Integer | (Optional) Number of results to return per page. Defaults to 50. |
cursor | String | (Optional) Pagination cursor for the next page of results. |
status | Integer | (Optional) Filter drivers by status (e.g., 1 for active, 0 for inactive). |
licenseState | String | (Optional) Filter drivers by the state where the license was issued. |
Example Request (cURL):
curl --request GET \
--url "https://api.analytics.autos/drivers?limit=50&status=1" \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Connection-Id: YOUR-CONNECTION-ID'
Response:
{
"status": 200,
"message": "Success",
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "John Doe",
"email": "[email protected]",
"phone": "123-456-7890",
"licenseState": "CA",
"licenseNumber": "A1234567",
"status": 1,
"connectionId": "connection123",
"createdAt": "2024-01-01T12:00:00Z"
}
],
"next": "eyJvZmZzZXQiOjEwMH0"
}
Response Fields Explained:
id
: Unique ID assigned to each driver for identification.name
: Full name of the driver.email
: Driver’s email address.phone
: Driver’s phone number.licenseState
: State where the driver’s license was issued.licenseNumber
: Driver’s license number.status
: Driver's status:0
: Inactive1
: Active2
: Suspended
connectionId
: Links the driver to the fleet.createdAt
: Timestamp of when the driver profile was created.next
: Pagination cursor for retrieving the next page of results. If absent, no additional pages are available.
Get Driver Details
Endpoint:
GET /drivers/{driverId}
Description:
Fetch detailed information about a specific driver using their unique ID. Includes status, licensing information, and associated connection details.
Path Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
driverId | Yes | String | The unique UUID of the driver. |
Headers:
Header | Type | Description |
---|---|---|
x-api-key | String | API key to authenticate the request. Obtain from portal. |
Connection-Id | UUID | (Optional) Specifies a particular connection to query. |
Example Request (cURL):
curl --request GET \
--url "https://api.analytics.autos/drivers/123e4567-e89b-12d3-a456-426614174000" \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Connection-Id: YOUR-CONNECTION-ID'
Response:
{
"status": 200,
"message": "Success",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": 1,
"name": "John Doe",
"email": "[email protected]",
"phone": "123-456-7890",
"licenseState": "CA",
"licenseNumber": "A1234567",
"connectionId": "connection123",
"rawDriverId": "raw123",
"createdAt": "2024-01-01T12:00:00Z"
}
}
Response Fields Explained:
id
: Unique ID of the driver.status
: Driver's status:0
: Inactive1
: Active2
: Suspended
name
: Driver's full name.email
: Driver’s email address.phone
: Driver’s phone number.licenseState
: State where the driver’s license was issued.licenseNumber
: Driver’s license number.connectionId
: Links the driver to the fleet.rawDriverId
: Identifier from the original data source.createdAt
: Timestamp of when the driver profile was created.
Updated 7 days ago