Referanse: Asset API
Alle endepunkter krever autentisering — se Autentisering. Basis-URL-er står under API.
Asset Resource
/assets/v2/asset
The filters are optional and can be combined. Categories and locations are referenced by orgadmin category id (Long); pass repeated query params for multi-select (?categoryIds=42&categoryIds=87). Subtree expansion is the frontend's job — pass the full id list (see docs/V2_API_GUIDE.md §5). Assets can be exported as csv ('Accept' header 'application/octet-stream') or pdf ('Accept' header 'application/pdf'), where the pdf export will be QR codes for the assets' tags
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
batchId | query | integer (int64) | |
categoryIds | query | liste av integer (int64) | |
format | query | PdfFormat | |
locationCategoryIds | query | liste av integer (int64) | |
search | query | string | |
states | query | liste av AssetState | |
X-auth-owner | header | string | |
pageOffset | query | integer (int32) | |
pageSize | query | integer (int32) |
Svar
| Status | Innhold |
|---|---|
200 | application/json — liste av AssetBasicDtoapplication/pdf — StreamingOutputtext/csv — StreamingOutput |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Forespørselskropp *
application/json— CreateAssetDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — AssetDto |
400 | – |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Forespørselskropp *
application/json— AssetMultiEditDto
Svar
| Status | Innhold |
|---|---|
204 | – |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
ids * | query | liste av integer (int64) | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
204 | – |
401 | – |
403 | – |
/assets/v2/asset/groups
Returns a flat list of { id, state, count } entries, keyed by whichever of `id` and `state` `by` selects — the other is null. For `by=category` and `by=location`, `id` is the categoryId or locationCategoryId; for `by=state` the key is the AssetState name. Buckets with no matching assets are omitted, as is the unassigned (null) location bucket. `by=state` does keep its null bucket: every asset has exactly one state, so those buckets sum to the total matching count, and only do so with the stateless assets among them. Backend is hierarchy-blind — frontend rolls counts up against the taxonomy tree. For `by=category`, an asset tagged with N categories contributes 1 to each of those N buckets, so the sum of counts may exceed the total matching asset count.
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
batchId | query | integer (int64) | |
by * | query | AssetGroupBy | |
categoryIds | query | liste av integer (int64) | |
locationCategoryIds | query | liste av integer (int64) | |
search | query | string | |
states | query | liste av AssetState | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — liste av AssetGroupDto |
401 | – |
403 | – |
/assets/v2/asset/import
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Forespørselskropp *
multipart/form-data— object
Svar
| Status | Innhold |
|---|---|
204 | – |
401 | – |
403 | – |
/assets/v2/asset/stats
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — AssetStatisticsDto |
401 | – |
403 | – |
/assets/v2/asset/{id}
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — AssetDto |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
application/json— UpdateAssetDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — AssetDto |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
204 | – |
401 | – |
403 | – |
/assets/v2/asset/{id}/documents
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
Accept-Language | header | string | |
X-auth-owner | header | string |
Forespørselskropp *
multipart/form-data— object
Svar
| Status | Innhold |
|---|---|
200 | application/json — AssetDto |
401 | – |
403 | – |
/assets/v2/asset/{id}/documents/{documentId}
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
documentId * | path | integer (int64) | |
id * | path | integer (int64) | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
204 | – |
401 | – |
403 | – |
/assets/v2/asset/{id}/documents/{documentId}/replace
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
documentId * | path | integer (int64) | |
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
multipart/form-data— object
Svar
| Status | Innhold |
|---|---|
200 | application/json — DocumentDto |
401 | – |
403 | – |
/assets/v2/asset/{id}/events
Adds a user-authored event (e.g. a completed service, control round or note) to the asset's activity log. Read it back via GET /event?type=ASSET&id={id}. The kind is one of AssetEventType; specifics belong in the free-text note. Optional documentIds must already be attached to this asset (POST /asset/{id}/documents). Requires write:assets; allowed cross-tenant wherever the asset is visible to the caller.
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
application/json— CreateAssetEventDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — EventDto |
400 | – |
401 | – |
403 | – |
Batch Resource
/assets/v2/batch
Returns a set of all batches
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
states | query | string | |
tag | query | string | |
types | query | string | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — liste av BatchDto |
401 | – |
403 | – |
If 'numberOfNewAssets' is set, type is set to ASSET_CREATION and 'assetIds' is ignored
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Forespørselskropp *
application/json— CreateBatchDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — BatchDto |
400 | – |
401 | – |
403 | – |
/assets/v2/batch/tags
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
n | query | integer (int32) |
Svar
| Status | Innhold |
|---|---|
200 | text/csv — StreamingOutput |
401 | – |
403 | – |
/assets/v2/batch/{id}
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | string | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — BatchDto |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
application/json— BatchMultiEditDto
Svar
| Status | Innhold |
|---|---|
204 | – |
400 | – |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
application/json— UpdateBatchDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — BatchDto |
401 | – |
403 | – |
Config Resource
/assets/v2/config/asset/states
/assets/v2/config/batch/states
/assets/v2/config/batch/types
/assets/v2/config/external
/assets/v2/config/pdf
/assets/v2/config/pdf/empty
/assets/v2/config/user/{id}
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — UserPreferencesDto |
401 | – |
403 | – |
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | string |
Forespørselskropp *
application/json— UserPreferencesDto
Svar
| Status | Innhold |
|---|---|
201 | – |
400 | – |
401 | – |
403 | – |
/assets/v2/config/warranty/period
Deviation Resource
/assets/v2/deviation
The 'states' query param is a comma separated list of DeviationState (OPEN, CLOSED); 'batchGuid' filters on the originating batch (e.g. a control round); 'assetId' on the anchoring asset.
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
assetId | query | integer (int64) | |
batchGuid | query | string | |
states | query | string | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — liste av DeviationDto |
401 | – |
403 | – |
A follow-up record for a fault found on an asset. Anchored on the asset ('assetId'); 'batchGuid' optionally references the batch (e.g. control round) it was found in. Creator and timestamp are server-derived. Optional documentIds must already be attached to the asset. Audited via the event log (GET /event?type=DEVIATION&id={id}).
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Forespørselskropp *
application/json— CreateDeviationDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — DeviationDto |
400 | – |
401 | – |
403 | – |
/assets/v2/deviation/{id}
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — DeviationDto |
401 | – |
403 | – |
Enrichment of correctiveAction, dueDate and responsible. A CLOSED deviation is immutable and rejects updates with 400.
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
application/json— UpdateDeviationDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — DeviationDto |
401 | – |
403 | – |
/assets/v2/deviation/{id}/close
Records the closing user id and timestamp as the auditable signature; the deviation is immutable afterwards. Closing an already CLOSED deviation is rejected with 400.
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
id * | path | integer (int64) | |
X-auth-owner | header | string |
Forespørselskropp *
application/json— CloseDeviationDto
Svar
| Status | Innhold |
|---|---|
200 | application/json — DeviationDto |
400 | – |
401 | – |
403 | – |
Event Resource
/assets/v2/event
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
action | query | EventAction | |
id | query | integer (int64) | |
pageOffset | query | integer (int32) | |
pageSize | query | integer (int32) | |
type | query | EventType | |
X-auth-owner | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — liste av EventDto |
401 | – |
403 | – |
Site Admin Asset Resource
/assets/v2/site/statistics
Tag Resource
/assets/v2/tag/{tag}
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
tag * | path | string | |
externalSystem | query | string | |
Accept-Language | header | string |
Svar
| Status | Innhold |
|---|---|
200 | application/json — AssetDtotext/html |
Warranty Resource
/assets/v2/warranty
Parametre
| Navn | I | Type | Beskrivelse |
|---|---|---|---|
X-auth-owner | header | string |
Forespørselskropp *
application/json— GrantWarrantyDto
Svar
| Status | Innhold |
|---|---|
204 | – |
400 | – |
401 | – |
403 | – |
Skjemaer
AssetBasicDto
| Felt | Type | Beskrivelse |
|---|---|---|
categoryIds | liste av integer (int64) | |
id | integer (int64) | |
locationCategoryId | integer (int64) | |
name | string | |
state | AssetState | Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED |
tag | string | |
thumbnails | liste av DocumentDto | |
warrantyExpiration | LocalDateTime |
AssetDto
| Felt | Type | Beskrivelse |
|---|---|---|
batches | liste av BatchDto | |
categoryIds | liste av integer (int64) | |
description | string | |
documents | liste av DocumentDto | |
externalIds | liste av ExternalIdDto | |
id | integer (int64) | |
locationCategoryId | integer (int64) | |
name * | string | |
owner | OwnerDto | |
properties | map av string | |
publicDpp | boolean | |
state | AssetState | Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED |
tag | string | |
thumbnails | liste av DocumentDto | |
warranty | WarrantyDto |
AssetEventResult
Én av: OK, DEVIATION
AssetEventType
Én av: INSPECTION, MAINTENANCE, REPAIR, INCIDENT, NOTE
AssetGroupBy
Én av: CATEGORY, LOCATION, STATE
AssetGroupDto
| Felt | Type | Beskrivelse |
|---|---|---|
count | integer (int64) | |
id | integer (int64) | |
state | string |
AssetMultiEditDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetIds * | liste av integer (int64) | |
categoryIds | liste av integer (int64) | |
deleteFields | liste av string | |
deleteFieldsSupported | boolean | |
locationCategoryId | integer (int64) | |
notMixingSetAndClear | boolean | |
publicDpp | boolean | |
recipientOrgId | string | |
state | AssetState | Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED |
stateNotProvisioned | boolean | |
transfer | boolean | |
transferExclusive | boolean |
AssetState
Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED
AssetStatisticsDto
| Felt | Type | Beskrivelse |
|---|---|---|
activeAssetCount | integer (int64) | |
eventCount | integer (int64) | |
eventsPerMonth * | map av integer (int64) | |
newAssetsPerMonth * | map av integer (int64) | |
organizationId * | string | |
organizationName | string |
BatchDto
| Felt | Type | Beskrivelse |
|---|---|---|
categoryIds | liste av integer (int64) | |
count | integer (int64) | |
description | string | |
guid | string | |
id | integer (int64) | |
name | string | |
owner | OwnerDto | |
properties | map av string | |
state | BatchState | Én av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED |
tag | string | |
timestamp | LocalDateTime | |
type | BatchType | Én av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER |
BatchMultiEditDto
| Felt | Type | Beskrivelse |
|---|---|---|
categoryIds | liste av integer (int64) | |
deleteFields | liste av string | |
deleteFieldsSupported | boolean | |
locationCategoryId | integer (int64) | |
notMixingSetAndClear | boolean | |
state | AssetState | Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED |
stateNotProvisioned | boolean | |
valid | boolean |
BatchState
Én av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED
BatchType
Én av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER
CloseDeviationDto
| Felt | Type | Beskrivelse |
|---|---|---|
note | string |
ConsecutiveAssetsDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetId * | integer (int64) | |
count | integer (int32) |
CreateAssetDto
| Felt | Type | Beskrivelse |
|---|---|---|
batches | liste av integer (int64) | |
categoryIds | liste av integer (int64) | |
description | string | |
externalIds | liste av ExternalIdDto | |
locationCategoryId | integer (int64) | |
name | string | |
properties | map av string | |
publicDpp | boolean |
CreateAssetEventDto
| Felt | Type | Beskrivelse |
|---|---|---|
batchGuid | string | |
documentIds | liste av integer (int64) | |
manualType * | AssetEventType | Én av: INSPECTION, MAINTENANCE, REPAIR, INCIDENT, NOTE |
note | string | |
result | AssetEventResult | Én av: OK, DEVIATION |
CreateBatchDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetIds | liste av integer (int64) | |
categoryIds | liste av integer (int64) | |
consecutiveAssetIds | ConsecutiveAssetsDto | |
description | string | |
guid | string | |
initialCount | integer (int64) | |
locationCategoryId | integer (int64) | |
name | string | |
numberOfNewAssets | integer (int32) | |
properties | map av string | |
state | BatchState | Én av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED |
type | BatchType | Én av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER |
CreateDeviationDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetId * | integer (int64) | |
batchGuid | string | |
description * | string | |
documentIds | liste av integer (int64) |
DeviationDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetId | integer (int64) | |
assetName | string | |
batchGuid | string | |
batchName | string | |
closeNote | string | |
closedAt | LocalDateTime | |
closedBy | string | |
correctiveAction | string | |
createdAt | LocalDateTime | |
createdBy | string | |
description | string | |
documentIds | liste av integer (int64) | |
dueDate | LocalDate | |
id | integer (int64) | |
responsible | string | |
state | DeviationState | Én av: OPEN, CLOSED |
DeviationState
Én av: OPEN, CLOSED
DocumentDto
| Felt | Type | Beskrivelse |
|---|---|---|
documentType | DocumentType | Én av: IMAGE, DOCUMENT, LINK, OTHER |
id | integer (int64) | |
url | string |
DocumentType
Én av: IMAGE, DOCUMENT, LINK, OTHER
EventAction
Én av: CREATE, ACTIVATE, UPDATE, APPROVE, START, COMPLETE, WARRANTY, SERVICE, DELETE, REQUEST, TRANSFER, MANUAL
EventDto
| Felt | Type | Beskrivelse |
|---|---|---|
action | EventAction | Én av: CREATE, ACTIVATE, UPDATE, APPROVE, START, COMPLETE, WARRANTY, SERVICE, DELETE, REQUEST, TRANSFER, MANUAL |
id | integer (int64) | |
properties | map av string | |
timestamp | LocalDateTime | |
type | EventType | Én av: ASSET, BATCH, ORDER, LOCATION, USER, DEVIATION |
user | string |
EventType
Én av: ASSET, BATCH, ORDER, LOCATION, USER, DEVIATION
ExternalIdDto
| Felt | Type | Beskrivelse |
|---|---|---|
id * | string | |
systemName * | string | |
urlStringFormat | string |
GrantWarrantyDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetId | integer (int64) | |
batchId | integer (int64) | |
duration | WarrantyPeriod | Én av: THREE_YEARS |
Language
Én av: ENGLISH, NORWEGIAN
LocalDate
string (date)
LocalDateTime
string (date-time)
OwnerDto
| Felt | Type | Beskrivelse |
|---|---|---|
id | string | |
name | string |
PdfFormat
Én av: A4_3X8_66MM, A4_3X8_70MM, A4_2X5_80MM, STRIP_1X1_40MM, A4_5X8_30MM, A4_5X8_30MM_CLEAN
StreamingOutput
object
UpdateAssetDto
| Felt | Type | Beskrivelse |
|---|---|---|
addBatches | liste av integer (int64) | |
batches | liste av integer (int64) | |
batchesUnambiguous | boolean | |
categoryIds | liste av integer (int64) | |
deleteFields | liste av string | |
description | string | |
documentIds | liste av integer (int64) | |
externalIds | liste av ExternalIdDto | |
locationCategoryId | integer (int64) | |
name | string | |
properties | map av string | |
publicDpp | boolean | |
state | AssetState | Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED |
stateNotProvisioned | boolean |
UpdateBatchDto
| Felt | Type | Beskrivelse |
|---|---|---|
assetIds | liste av integer (int64) | |
categoryIds | liste av integer (int64) | |
count | integer (int64) | |
deleteFields | liste av string | |
description | string | |
guid | string | |
locationCategoryId | integer (int64) | |
name | string | |
state | BatchState | Én av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED |
type | BatchType | Én av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER |
UpdateDeviationDto
| Felt | Type | Beskrivelse |
|---|---|---|
correctiveAction | string | |
dueDate | LocalDate | |
responsible | string |
UserPreferencesDto
| Felt | Type | Beskrivelse |
|---|---|---|
language | Language | Én av: ENGLISH, NORWEGIAN |
WarrantyDto
| Felt | Type | Beskrivelse |
|---|---|---|
expiration | LocalDateTime | |
granted | LocalDateTime | |
grantedByOrganization | string | |
grantedByUserId | string | |
id | integer (int64) |
WarrantyPeriod
Én av: THREE_YEARS