The Maintenance API provides queries and events for interacting with the services that record maintenance on a vehicle.
Return Results
The Fuel API returns fuel details. A trip summary contains the following data fields
Name | Type | Calculated | Description |
id | Integer | yes | The internal system identifier for this trip. Uses time the record is created as key. |
timestamp | DateTime | yes | The time of the purchase. Can be given or calculated. |
troubleCodes | String Array | no | Trouble codes that generated alert, if any |
odometer | Float | no | Odometer reading at fillup |
activity | String | no | The activity associated with the trouble code (e.g. oil change, tire rotation, etc.) |
reason | String | no | English language explanation for the record |
reminderRef | UUID | yes | The ID of the reminder that generated this alert. Null if none. |
DateTime is an ISO8901 formatted time. Returned times are always UTC
Queries
The query domains for the Trips API are
development | b16x21 |
---|---|
production | fuse_maintenance |
The production version is always pre-pended to the production query domain with a underbar, so for version 1 of the API would use v1_fuse_maintenance
as the query domain. In this document we will use the production query domain without the version. See Fuse Base URLs for more information on how to turn the descriptions shown here into a query URL.
fuse_maintenance:alerts([<id>]|[<offset>, [<limit>]])
Query alerts. All parameters are optional. With <id>
, the detailed fillup data for a specific fillup is returned. Without <id>
, <offset> and <limit> allow for pagination. Defaults for <offset> and <limit> are 0 and 10 respectively.
For example, to return the ten most recent alerts, you would simply for the following:
fuse_maintenance:alerts()
To return the data for a specific alert:
fuse_maintenance:alerts("73660370-145E-11E4-9670-1AACE71C24E1")
fuse_maintenance:fillupsByDate(<start>, <end>)
Query past fillups for those between a start and end time. Summary fillup data is returned. Times are expressed in ISO8901 format.
For example to find all the fillups for June 2014 in the US Mountain time zone:
fuse_maintenance:fillupsByDate(start="20140601T000000-0600", end="20140701T000000-0600")
Events
The following events are used defined for fillups in the Fuse API.
fuse:new_alert
A new fillup has been detected with the following attributes:
Name | Type | Required | Description |
troubleCodes | String Array | no | Trouble codes that generated alert, if any |
odometer | Float | no | Odometer reading at fillup |
activity | String | yes | no | The activity associated with the trouble code (e.g. oil change, tire rotation, etc.) |
reason | String | no | English language reason for the alert. |
reminderRef | UUID | no | yes | The ID of the reminder that generated this alert. Null if none. |
If a reminderRef
is given, activity
will be taken from that, otherwise, activity
is required.
Odometer
is taken from the vehicle's current odometer reading unless supplied.
fuse:updated_alert
An alert with the given ID is to be updated.
Name | Type | Required | Description |
id | Integer | yes | The internal system identifier for this trip. Uses time the record is created as key. |
troubleCodes | String Array | no | Trouble codes that generated alert, if any |
odometer | Float | no | Odometer reading at fillup |
activity | String | no | The activity associated with the trouble code (e.g. oil change, tire rotation, etc.) |
reason | String | no | English language reason for the alert. |
reminderRef | UUID | no | The ID of the reminder that generated this alert. Null if none. |
Note: updates are not partial. You must supply all the parameters. This is likely to change in a future version of the API.
fuse:unneeded_alert
Delete the alert record with the given id.
Name | Type | Description |
id | DateTime | id for the record to delete |
Services
fuse_maintenance:record_fuel_purchase
Selector:
select when fuse new_fuel_purchase
Synopsis:
Records a new fuel purchase. Uses fuse_maintenance:update_fuel_purchase
Raises:
fuse_maintenace:update_fuel_purchase
Selector:
select when fuse updated_fuel_purchase
Synopsis:
Updates a fuel purchase.
Raises:
none
fuse_trips:delete_fuel_purchase
Selector:
select when fuse unneeded_fuel_purchase
Synopsis:
Deletes the fuel purchase for a given ID
Raises:
none