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 onlyExpressionis supported. Example:ExpressiondataObjectName(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_temperatureexpression(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;bis not.
- Must be a single line. Characters
- 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;
- Value form:
- Examples:
- Capability
temperature→(temperature * 1.8) + 32 - Capability
humidity→humidity / 100 - Capability
voltage→voltage * 0.95
- Capability
- 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.,
Responses
200 OK: Returns the created transfer function. Response fields:transferFunctionId: Unique identifier (GUID string)type: Transfer type (expression)dataObjectName: Output data object nameexpression: Mathematical expressionisEnabled: Whether the transfer function is active (alwaystrueon creation)creationTime: ISO 8601 creation timestamplastModificationTime: 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
- 200
OK