This endpoint enables you to search for maintenance records based on various criteria such as trailer IDs, categories, status, and date ranges. It returns a list of maintenance records that match the provided search terms.
The Search Maintenance API endpoint allows you to search for maintenance records within the Alvys system based on various criteria such as asset type, category, status, and date range. This endpoint provides detailed information about each maintenance record that matches the search criteria, facilitating efficient management and retrieval of maintenance records.
Request Parameters
The following parameter is required in the URL path:
Parameter | Type | Required | Description |
---|---|---|---|
version | String | Yes | The API version to use. |
Request Body
The following fields are required 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. |
truckIds | Array of Strings | Conditionally | A list of truck IDs to filter by. This field is required if the other conditionally required fields are left empty. |
trailerIds | Array of Strings | Conditionally | A list of trailer IDs to filter by. This field is required if the other conditionally required fields are left empty. |
categories | Array of Strings | Conditionally | A list of categories to filter by. This field is required if the other conditionally required fields are left empty. |
status | String | Conditionally | The status of the maintenance record. This field is required if the other conditionally required fields are left empty. |
dateRange | Object | Conditionally | The date range for the maintenance records. This field is required if the other conditionally required fields are left empty. |
dateRange.start | String (Date-Time) | Conditionally | The start date of the maintenance records range. This field is required if the other conditionally required fields are left empty. |
dateRange.end | String (Date-Time) | Conditionally | The end date of the maintenance records range. This field is required if the other conditionally required fields are left empty. |
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/maintenance/search' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ....' \
--header 'Content-Type: application/json' \
--data '{
"page": 0,
"pageSize": 100,
"truckIds": [
"TR123456789"
],
"trailerIds": [
""
],
"categories": [
"Tires"
],
"status": "Open",
"dateRange": {
"start": "2021-01-23T13:36:42.021Z",
"end": "2024-08-23T13:36:42.021Z"
}
}'
Response Parameters
The following table lists the parameters included in the response for maintenance 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 maintenance records. |
items | Array of Objects | Yes | The list of maintenance records matching the criteria. |
items.id | String | Yes | The unique identifier of the maintenance record. |
items.po | String | No | The purchase order number associated with the maintenance. |
items.reference | String | No | A reference string for the maintenance record. |
items.relatedAsset | Object | No | Details about the related asset for the maintenance. |
items.relatedAsset. assetId | String | No | The unique identifier of the asset. |
items.relatedAsset. assetNumber | String | No | The asset number. |
items.relatedAsset. assetType | String | No | The type of asset (e.g., Truck, Trailer). |
items.category | Object | No | The category of the maintenance work. |
items.category.id | String | No | The unique identifier of the category. |
items.category.name | String | No | The name of the category. |
items.description | String | No | A description of the maintenance work. |
items.comments | String | No | Additional comments or notes about the maintenance. |
items.amount | Object | No | The total amount for the maintenance work. |
items.amount.amount | Number | No | The amount value. |
items.amount.currency | String | No | The currency of the amount. |
items.repairShop | Object | No | Information about the repair shop. |
items.repairShop.id | String | No | The unique identifier of the repair shop. |
items.repairShop.name | String | No | The name of the repair shop. |
items.reminders | Array | No | A list of reminders associated with the maintenance. |
items.reminders.id | String | No | The unique identifier of the reminder. |
items.reminders. dueDate | String (Date-Time) | No | The due date for the reminder. |
items.createdAt | String (Date-Time) | Yes | The date and time when the maintenance record was created. For some maintenance records, the CreatedAt field may display 1970-01-01T00:00:00+00:00 . This placeholder represents the Unix Epoch and indicates that the original creation timestamp is unavailable. Users should interpret this as an unknown creation date, specific only to the CreatedAt field and not reflective of other timestamps or data. |
items.createdBy | String | No | The user who created the maintenance record. |
items.modifiedAt | String (Date-Time) | No | The date and time when the maintenance record was last modified. |
items.modifiedBy | String | No | The user who last modified the maintenance record. |
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 completing the fields for the parameters below. 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.