Unit conversion
Convert Units
Calculates conversion factor for the given pair of units.
The tenant name.
testtenant
The factor has been successfully calculated.
The conversion factor cannot be fetched due to wrong parameters.
Given request is unauthorized - the authorization token is invalid or has expired.
Details will be provided in the response payload.
At least one of the specified units cannot be found.
Unexpected server error
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"
}
}
{
"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.
The tenant name.
testtenant
The unit has ben successfully converted.
The unit cannot be converted due to wrong parameters.
Given request is unauthorized - the authorization token is invalid or has expired.
Details will be provided in the response payload.
At least one of the specified units cannot be found.
Unexpected server error
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"
}
}
{
"commandUuid": "83ddc478-89d7-48e1-8b6c-527f4c67fb56",
"input": {
"sourceUnitAmount": 100,
"sourceUnit": "us-fl-oz",
"targetUnit": "cl"
},
"output": {
"targetUnitAmount": 295.735296,
"targetUnit": "cl"
}
}
Was this helpful?