Assets API
What is owned and kept running: assets and premises, visits, problems, the vendor book, checklists and incidents.
The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.
GET/v1/assets
The register
Everything owned and kept running, with its warranty and service clocks. The warranty runs to the later of the seller's terms and the legal minimum for the country; a minimum from a country row that is not firm is marked about. Needs miniself:read.
Scope assets:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
parent | query | string | No | Only things in this premises. |
state | query | string | No | Only things in this state. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/assets
Add an asset
Adds a thing or a premises. Premises are not inside anything; a thing sits in premises or nowhere. Needs miniself:write.
Scope assets:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/assets/{id}
One asset
The asset with its clocks. Needs miniself:read.
Scope assets:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
PUT/v1/assets/{id}
Change an asset
Replaces the asset when expected_version is the version you read; one changed by someone else is refused with 409. Needs miniself:write.
Scope assets:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/assets/{id}/counter
Read the counter
Records what the counter (kilometres, hours) shows. It never goes backwards. Needs miniself:write.
Scope assets:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/assets/{id}/jobs
Visits to an asset
Who came, what it cost and which parts went in, newest first. Needs miniself:read.
Scope assets:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/assets/{id}/jobs
Record a visit
Records who came and what was done. A service or inspection restarts the service clock; a visit that names a problem marks it fixed. Needs miniself:write.
Scope assets:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/assets/{id}/problems
Problems on one asset
What was reported on this asset, newest first. Needs miniself:read.
Scope assets:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
live | query | boolean | No | Only problems still open or booked when true. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/assets/{id}/problems
Report a problem
One tap. Opens a case that already knows whether the warranty still runs, who stands behind it and what to do first. Needs miniself:write.
Scope assets:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/asset-problems
Problems reported
Newest first. Needs miniself:read.
Scope asset-problems:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
asset | query | string | No | Only problems on this asset. |
live | query | boolean | No | Only problems still open or booked. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/asset-problems/{id}/book
Book a vendor
Says which vendor is coming. Needs miniself:write.
Scope asset-problems:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/asset-problems/{id}/close
Close a problem
Closes a problem without a fix: not worth it, sold, gone. Needs miniself:write.
Scope asset-problems:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/asset-vendors
The vendor book
Vendors ranked on what a visit costs, how long a fix takes and how often they have to come back. A vendor with fewer than two visits is listed without a rank. Needs miniself:read.
Scope asset-vendors:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
trade | query | string | No | Only vendors who do this trade, and their visits of it. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/asset-vendors
Add a vendor
Adds a vendor to the book. Needs miniself:write.
Scope asset-vendors:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
PUT/v1/asset-vendors/{id}
Change a vendor
Replaces the vendor's entry. A vendor the owner stops using is made inactive, not removed. Needs miniself:write.
Scope asset-vendors:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/checklists
Checklists
Opening, closing and other checklists. Needs miniself:read.
Scope checklists:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
at | query | string | No | Only checklists for this premises or asset. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/checklists
Add a checklist
Adds a checklist of 1 to 60 items. Needs miniself:write.
Scope checklists:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
PUT/v1/checklists/{id}
Change a checklist
Replaces the checklist. Runs already started keep their items. Needs miniself:write.
Scope checklists:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/checklists/{id}/runs
Runs of one checklist
The runs of this checklist, newest first. Needs miniself:read.
Scope checklists:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
open | query | boolean | No | True: only runs still open. False: only closed ones. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/checklists/{id}/runs
Start doing a checklist
Starts a run for a day. Needs miniself:write.
Scope checklists:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/checklist-runs
Checklist runs
What was done and what was missed, newest first. Needs miniself:read.
Scope checklist-runs:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
checklist | query | string | No | Only runs of this checklist. |
open | query | boolean | No | True: only runs still open. False: only closed ones. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/checklist-runs/{id}/items
Tick an item
Marks one item done or not done. An item that needs a photo is not done without one. Needs miniself:write.
Scope checklist-runs:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/checklist-runs/{id}/close
Close a run
Closes the run. Each item left undone needs a note saying why. Needs miniself:write.
Scope checklist-runs:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/incidents
Incidents
Newest first. Needs miniself:read.
Scope incidents:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
open | query | boolean | No | Only incidents not yet closed. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/incidents
Report an incident
Records what happened, where, who was hurt and who was told. Someone hurt needs a person named in people. Needs miniself:write.
Scope incidents:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
POST/v1/incidents/{id}/close
Close an incident
Closes it. An incident where someone was hurt, or an emergency, is not closed until someone was told. Needs miniself:write.
Scope incidents:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |