You can instantly convert a metric's units on the fly directly within the IO-base modules (Explorer, IndaBoard, API, etc.).
For any metric that has been previously configured for unit conversion, you can convert its values into a different unit than the one initially displayed.
In Explorer :
This option is directly accessible from the curve configuration screen :
In IndaBoard :
Similarly, IndaBoard allows you to select another unit for dynamic and immediate conversion on the component editing page.
Using the API :
Once unit conversion is configured on a metric, you can leverage it directly in your API calls, notably from the API Console. The conversion is performed by adding the targetUnit
parameter in the body of your request (for example, on the latest
endpoint).
To simplify your requests, dynamic aliases are available to refer to your preconfigured units:
For target unit 1, use the value
$target_unit_1
.For target unit 2, use the value
$target_unit_2
.
In response, the API will return the metric's value directly converted into the corresponding unit.
Note : The API also allows you to request a conversion to any other valid unit, even if it is not defined as a target unit. To do this, simply specify the full name of the desired unit in the targetUnit
field.
Note : If you specify an invalid or incompatible unit for the metric's category (for example, converting kilograms to meters), the API will return a 422 error with the message: "Target unit is invalid".