Skip to main content

Create transfer function

POST 

/api/v1/devices/{deviceId}/inputs/data-objects/transfer-functions

Create a new transfer function to transform data object values using mathematical expressions.

Path Parameters

  • deviceId (string, required): Device identifier. The device must exist in the system. Example: 9f75abda56c3

Request Body Parameters

  • type (FunctionTransferType, required): Type of transfer function. Currently only Expression is supported. Example: Expression
  • dataObjectName (string, required): Output data object name for the transformed value. Must be unique for the device. Accepted formats: camelCase, snake_case, or single word. No all-digit names or special characters. Example: calibrated_temperature
  • expression (string, required): Mathematical expression for the transformation. Supports arithmetic operators (+, -, *, /, %) and parentheses for grouping.
    • A variable in the expression represents the current value of an input data object on the device; use the exact data object name as the identifier (e.g., temperature, voltage).
    • Exactly one variable is allowed. The API only validates expression syntax; it does not verify whether the variable name corresponds to an actual data object on the device. If the variable does not match any data object reported by the device, the expression will silently produce no output at the edge.
    • If the expression contains multiple variable names, only the first one alphabetically takes effect.
    • Format constraints:
      • Must be a single line. Characters \n, \r, U+2028, and U+2029 are not allowed.
      • At most one semicolon (;) is allowed.
      • If a semicolon is present, it must be the last non-whitespace character. Example: temperature * 1.8; is valid; a;b is not.
    • Executable expression: A trailing ; marks the expression as a complete executable statement that can be executed by the Dynamic LINQ engine. Without a trailing ;, the expression is treated as a value expression. Both produce the same result.
      • Value form: temperature * 1.8
      • Executable form: temperature * 1.8;
    • Examples:
      • Capability temperature(temperature * 1.8) + 32
      • Capability humidityhumidity / 100
      • Capability voltagevoltage * 0.95

Responses

  • 200 OK: Returns the created transfer function. Response fields:
    • transferFunctionId: Unique identifier (GUID string)
    • type: Transfer type (expression)
    • dataObjectName: Output data object name
    • expression: Mathematical expression
    • isEnabled: Whether the transfer function is active (always true on creation)
    • creationTime: ISO 8601 creation timestamp
    • lastModificationTime: ISO 8601 last update timestamp (null on creation)
  • 400 Bad Request: Invalid request parameters or expression syntax.
  • 409 Conflict: Transfer function already exists for the device and output name combination.

Security

  • This API requires authentication.

Request

Responses

OK