Was this helpful?
Convert Units
Calculates conversion factor for the given pair of units.
The tenant name.
testtenant
The input payload.
PUT /unit-handling/{tenant}/units/conversion-factor-commands HTTP/1.1 Host: api.emporix.io Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: application/json Accept: */* Content-Length: 88 { "commandUuid": "text", "input": { "sourceUnitAmount": 1, "sourceUnit": "g", "targetUnit": "kg" } }
The factor has been successfully calculated.
{ "commandUuid": "e948a54d-ffeb-405a-9614-c68406274554,", "input": { "sourceUnit": "us-fl-oz,", "targetUnit": "cl" }, "output": { "conversionFactor": 2.95735296 } }
Converts the source unit to a target unit.
PUT /unit-handling/{tenant}/units/convert-unit-commands HTTP/1.1 Host: api.emporix.io Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: application/json Accept: */* Content-Length: 90 { "commandUuid": "text", "input": { "sourceUnitAmount": 100, "sourceUnit": "g", "targetUnit": "kg" } }
The unit has ben successfully converted.
{ "commandUuid": "83ddc478-89d7-48e1-8b6c-527f4c67fb56", "input": { "sourceUnitAmount": 100, "sourceUnit": "us-fl-oz", "targetUnit": "cl" }, "output": { "targetUnitAmount": 295.735296, "targetUnit": "cl" } }