The Search Drivers API endpoint allows you to search for drivers within the Alvys TMS system based on various criteria such as status, name, employee ID, fleet name, and active status.
This endpoint provides detailed information about each driver that matches the search criteria, facilitating efficient management and retrieval of driver records. The endpoint requires specifying the API version in the URL path. This ensures that your application interacts with the correct version of the API, providing stability and compatibility as the API evolves. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
Request Parameters
The following parameter is required in the URL path:
Parameter | Type | Required | Description |
---|---|---|---|
version | String | Yes | The API version to use. |
Body Request
The following fields can be included in the request body to filter the search results:
Parameter | Type | Required | Description |
---|---|---|---|
page | Integer | No | The page number to retrieve. |
pageSize | Integer | Yes | The number of results per page. PageSize must be greater than 0. |
status | Array of Strings | Conditionally | A list of statuses to filter by. This field is required if the other conditionally required fields are left empty. |
name | String | Conditionally | The name of the driver to search for. This field is required if the other conditionally required fields are left empty. |
employeeId | String | Conditionally | The employee ID of the driver to search for. This field is required if the other conditionally required fields are left empty. |
fleetName | String | Conditionally | The fleet name associated with the driver. This field is required if the other conditionally required fields are left empty. |
isActive | Boolean | No | Whether to filter by active drivers. |
Example CURL request
Use the Current API version number and make sure to replace the Authorization header value with your actual Bearer token for the request:
curl --location 'https://integrations.alvys.com/api/p/v1/drivers/search' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkplA' \
--header 'Content-Type: application/json' \
--data '{
"page": 0,
"pageSize": 50,
"status": [
"OFF DUTY"
],
"name": "",
"employeeId": "",
"fleetName": "",
"isActive": true
}'
Response Parameters
The following table lists the parameters included in the response for driver search requests:
Parameter | Type | Required | Description |
---|---|---|---|
page | Integer | Yes | The current page number of the results. |
pageSize | Integer | Yes | The number of results per page. |
total | Integer | Yes | The total number of matching drivers. |
items | Array of Objects | Yes | The list of driver records matching the search criteria. |
items.id | String | Yes | The unique identifier of the driver. |
items.employeeId | String | No | The employee ID of the driver. |
items.phoneNumber | String | No | The phone number of the driver. |
items.userId | String | No | The user ID associated with the driver. |
items.email | String | No | The email address of the driver. |
items.name | String | No | The name of the driver. |
items.type | String | No | The type of driver (e.g., Full-time, Part-time). |
items.subsidiaryId | String | No | The subsidiary ID to which the driver belongs. |
items.address | Object | No | The address details of the driver. |
items.address.street | String | No | The street address of the driver. |
items.address.city | String | No | The city of the driver's address. |
items.address.state | String | No | The state of the driver's address. |
items.address.zipCode | String | No | The zip code of the driver's address. |
items.status | String | No | The current status of the driver (e.g., Active, Inactive). |
items.licenseNum | String | No | The driver's license number. |
items.licenseState | String | No | The state that issued the driver's license. |
items.licenseExpiresAt | String (Date-Time) | No | The expiration date of the driver's license. |
items.medicalExpiresAt | String (Date-Time) | No | The expiration date of the driver's medical certificate. |
items.hiredAt | String (Date-Time) | No | The date when the driver was hired. |
items.terminatedAt | String (Date-Time) | No | The date when the driver was terminated, if applicable. |
items.notes | Array | No | An optional list of notes related to the driver. |
items.notes.id | String | No | The unique identifier of the note. |
items.notes.description | String | No | The description of the note. |
items.notes.noteType | String | No | The type of the note. |
items.notes.time | String (Date-Time) | No | The time the note was created. |
items.notes.user | String | No | The user who created the note. |
items.fleet | Object | No | The fleet information associated with the driver. |
items.fleet.id | String | No | The unique identifier of the fleet. |
items.fleet.name | String | No | The name of the fleet. |
items.createdAt | String (Date-Time) | Yes | The date and time when the driver was created in Alvys. |
Example Response
On the right side, you can see examples of different error codes by clicking "Example" and selecting the response code.
Rate Limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the Rate Limits section.
This page is interactive, allowing you to try a request by specifying the API version in the URL path. As you fill out the parameters, the Curl command on the right side of the page will be automatically updated. Alternatively, you can directly edit the Curl command. Make sure to authorize yourself before trying a request.