Units Of Measure
- Last UpdatedJan 10, 2025
- 4 minute read
The API in this section interacts with units of measure. Read/Get operations only. Update/Write operations interact through the quantity API.
List Units of Measure
Returns a list of all available units of measure in the system.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Units
?filter={filter}&skip={skip}&count={count}&orderby={orderby}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.
[optional] string filter
Filter expression.[optional] integer skip
Parameter representing the zero-based offset of the first SdsUomQuantity to retrieve. If not specified, a default value of 0 is used[optional] integer count
Parameter representing the maximum number of SdsUomQuantity to retrieve. If not specified, a default value of 100 is used[optional] string orderby
Parameter representing sorted order of returned objects. A field name is required. The sorting is based on the stored values for the given field.
For example, orderby=name would sort the returned results by the name values (ascending by default).
Additionally, a value can be provided along with the field name to identify whether to sort ascending or descending,
by using values asc or desc, respectively.
For example, orderby=name desc would sort the returned results by the name values, descending.
If no value is specified, there is no sorting of results.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | SdsUom[] | Returns a list of SdsUom objects |
| 400 | ErrorResponseBody | One of the resources specified was invalid or missing |
| 401 | ErrorResponseBody | Unauthorized |
| 403 | ErrorResponseBody | Forbidden |
| 404 | ErrorResponseBody | One of the resources specified was not found |
| 500 | ErrorResponseBody | An error occurred while processing the request |
| 503 | ErrorResponseBody | Service Unavailable |
Example response body
200 Response
HTTP/1.1 200
Content-Type: application/json
[
{
"Id":"count",
"Abbreviation":"count",
"Name":"count",
"DisplayName":"count",
"QuantityId":"Quantity",
"ConversionFactor":1
},
{
"Id":"Ampere hour",
"Abbreviation":"Ah",
"Name":"Ampere hour",
"DisplayName":"Ampere hour",
"QuantityId":"Electric Charge",
"ConversionFactor":3600
},
{
"Id":"coulomb",
"Abbreviation":"C",
"Name":"coulomb",
"DisplayName":"coulomb",
"QuantityId":"Electric Charge",
"ConversionFactor":1
}
]
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Get Unit of Measure
Returns the unit of measure corresponding to the specified uomId within a given namespace.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/Units/{uomId}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string uomId
The unit of measure identifier
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | SdsUom | Returns the SdsUom |
| 400 | ErrorResponseBody | One of the resources specified was invalid or missing |
| 401 | ErrorResponseBody | Unauthorized |
| 403 | ErrorResponseBody | Forbidden |
| 404 | ErrorResponseBody | One of the resources specified was not found |
| 500 | ErrorResponseBody | An error occurred while processing the request |
| 503 | ErrorResponseBody | Service Unavailable |
Example response body
200 Response
HTTP/1.1 200
Content-Type: application/json
{
"Id":"ounce",
"Abbreviation":"oz",
"Name":"ounce",
"DisplayName":"ounce",
"QuantityId":"Mass",
"ConversionFactor":0.028349523
}
400 Response (ErrorResponseBody)
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}
Definitions
SdsUom
DataContract representing a unit of measure.
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Id | string | false | true | Unique identifier for this unit of measure. |
| Abbreviation | string | false | true | Abbreviation for this unit of measure. |
| Name | string | false | true | Full name for this unit of measure. |
| DisplayName | string | false | true | Display name for this unit of measure. |
| QuantityId | string | false | true | The Id of the quantity that this unit is a measure of. |
| ConversionFactor | double | false | false | When a value of this unit is multiplied by the ConversionFactor and then incremented by the ConversionOffset, the value in terms of the base unit of the corresponding quantity is returned. |
| ConversionOffset | double | false | false | When a value of this unit is multiplied by the ConversionFactor and then incremented by the ConversionOffset, the value in terms of the base unit of the corresponding quantity is returned. |
| CreatedDate | date-time | false | false | The DateTime in ISO 8601 extended format and UTC time standard when the SdsUom was created. This value is set upon object creation and is immutable. The default value of the CreatedDate property of existing objects is DateTime.MinValue. This property cannot be modified by users. |
| ModifiedDate | date-time | false | false | The DateTime in ISO 8601 extended format and UTC time standard when the SdsUom was last modified. This value is initialized upon object creation and is updated each time an object's properties are successfully modified. The ModifiedDate property of an object will also update if the object's ACL or owner is modified. The default value of the ModifiedDate property of existing objects is DateTime.MinValue. This property cannot be modified by users. |
{
"Id": "string",
"Abbreviation": "string",
"Name": "string",
"DisplayName": "string",
"QuantityId": "string",
"ConversionFactor": 0,
"ConversionOffset": 0,
"CreatedDate": "2019-08-24T14:15:22Z",
"ModifiedDate": "2019-08-24T14:15:22Z"
}
ErrorResponseBody
The error response contains standard details on the cause and resolution of the error.
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| OperationId | string | false | true | Operation unique identifier of action that caused the error |
| Error | string | false | true | Error description |
| Reason | string | false | true | Reason for the error |
| Resolution | string | false | true | Resolution to resolve the error |
| Parameters | object | false | true | IDs or values that are creating or are affected by the error |
{
"OperationId": "string",
"Error": "string",
"Reason": "string",
"Resolution": "string",
"Parameters": {
"property1": "string",
"property2": "string"
}
}