The Unit Categories endpoint in API Services returns every UoMListType found in the database. A Unit Category contains units, which are UoMEnums related to the Unit Category by a Contains relationship. For example the Unit Category, MassUoM, contains the units gram and kilogram. The ID of a Unit Category is taken from the Unit Category UID in the database.
Each Unit Category also contains a base unit, which is what the other units are derived from. For example the MassUoM Unit Category has kilogram as the base unit.
You can return the Unit Categories from a query using the following example navigation GET:
<ACCESS_URL>/api/v1/UnitCategories
Units
The units of a Unit Category can be viewed either by expanding or navigating to the Units property:
<ACCESS_URL>/api/v1/UnitCategories?$expand=Units
<ACCESS_URL>/api/v1/UnitCategories('LengthUoM')/Units
You can return the units for length using the following example expansion GET:
<ACCESS_URL>/api/v1/UnitCategories('LengthUoM')?$expand=Units
Base units
Unit Categories have a base unit, which can be viewed by expanding or navigating to the BaseUnit or DefaultUnit, as follows:
<ACCESS_URL>/api/v1/UnitCategories?$expand=BaseUnit
<ACCESS_URL>/api/v1/UnitCategories?$expand=DefaultUnit
<ACCESS_URL>/api/v1/UnitCategories('LengthUoM')/BaseUnit
<ACCESS_URL>/api/v1/UnitCategories('LengthUoM')/DefaultUnit
You can return the base unit for length using the following example expansion GET:
<ACCESS_URL>/api/v1/UnitCategories('LengthUoM')?$expand=BaseUnit