latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

calculated-field-controller

Create Or Update Calculated Field (saveCalculatedField)

Creates or Updates the Calculated Field. When creating calculated field, platform generates Calculated Field Id as time-based UUID. The newly created Calculated Field Id will be present in the response. Specify existing Calculated Field Id to update the calculated field. Referencing non-existing Calculated Field Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Calculated Field entity.

Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.

post/api/calculatedField

Request body

createdTimeinteger

Timestamp of the calculated field creation, in milliseconds

type'SIMPLE' | 'SCRIPT' | 'GEOFENCING' | 'ALARM' | 'PROPAGATION' | 'RELATED_ENTITIES_AGGREGATION' | 'ENTITY_AGGREGATION'
namestring

User defined name of the calculated field.

debugModeboolean
configurationVersioninteger

Version of calculated field configuration.

versioninteger

Example request

{
  "id": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "CALCULATED_FIELD"
  },
  "createdTime": 1609459200000,
  "tenantId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "TENANT"
  },
  "entityId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "DEVICE"
  }
}

Response

OK

createdTimeinteger

Timestamp of the calculated field creation, in milliseconds

type'SIMPLE' | 'SCRIPT' | 'GEOFENCING' | 'ALARM' | 'PROPAGATION' | 'RELATED_ENTITIES_AGGREGATION' | 'ENTITY_AGGREGATION'
namestring

User defined name of the calculated field.

debugModeboolean
configurationVersioninteger

Version of calculated field configuration.

versioninteger

Example response

{
  "id": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "CALCULATED_FIELD"
  },
  "createdTime": 1609459200000,
  "tenantId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "TENANT"
  },
  "entityId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "DEVICE"
  }
}