Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

NameTypeCalculatedDescription
idIntegeryesThe internal system identifier for this trip. Uses time the record is created as key.
timestampDateTimeyesThe time of the purchase. Can be given or calculated.
troubleCodesString ArraynoTrouble codes that generated alert, if any
odometerFloat  no

Odometer reading at fillup

activityStringnoThe activity associated with the trouble code (e.g. oil change, tire rotation, etc.)
reminderRefUUIDyesThe 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

developmentb16x21
productionfuse_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:

NameTypeRequiredDescription
troubleCodesString ArraynoTrouble codes that generated alert, if any
odometerFloat  no

Odometer reading at fillup

activityStringyes | noThe activity associated with the trouble code (e.g. oil change, tire rotation, etc.)
reminderRefUUIDno | yesThe 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. 

NameTypeRequiredDescription
idIntegeryesThe internal system identifier for this trip. Uses time the record is created as key.
troubleCodesString ArraynoTrouble codes that generated alert, if any
odometerFloat  no

Odometer reading at fillup

activityStringnoThe activity associated with the trouble code (e.g. oil change, tire rotation, etc.)
reminderRefUUIDnoThe 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.

NameTypeDescription
idDateTimeid for the record to delete

Services

The following services operate in the Fuel API

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:updated_fuel_purchase

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

  • No labels