GET api/unitclasses/{unitClassId}/units

Gets the units by unit class identifier.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
unitClassId

The unit class identifier.

integer

Required

Body Parameters

None.

Response Information

Resource Description

Collection of UnitViewModel
NameDescriptionTypeAdditional information
Id

integer

Required

ClassId

integer

Required

IsDefault

boolean

None.

ShortName

string

Required

Max length: 10

MediumName

string

Required

Max length: 15

LongName

string

Required

Max length: 30

Conversion

decimal number

Required

Seconds

integer

None.

BaseUnitId

integer

None.

Links

Gets the links.

Collection of LinkModel

None.

Response Formats

application/json, text/json

Sample:
[
  {
    "id": 1,
    "classId": 2,
    "isDefault": true,
    "shortName": "sample string 4",
    "mediumName": "sample string 5",
    "longName": "sample string 6",
    "conversion": 7.1,
    "seconds": 1,
    "baseUnitId": 1
  },
  {
    "id": 1,
    "classId": 2,
    "isDefault": true,
    "shortName": "sample string 4",
    "mediumName": "sample string 5",
    "longName": "sample string 6",
    "conversion": 7.1,
    "seconds": 1,
    "baseUnitId": 1
  }
]

application/xml, text/xml

Sample:
<ArrayOfUnitViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TelogWebAPI.Models">
  <UnitViewModel>
    <BaseUnitId>1</BaseUnitId>
    <ClassId>2</ClassId>
    <Conversion>7.1</Conversion>
    <Id>1</Id>
    <IsDefault>true</IsDefault>
    <LongName>sample string 6</LongName>
    <MediumName>sample string 5</MediumName>
    <Seconds>1</Seconds>
    <ShortName>sample string 4</ShortName>
  </UnitViewModel>
  <UnitViewModel>
    <BaseUnitId>1</BaseUnitId>
    <ClassId>2</ClassId>
    <Conversion>7.1</Conversion>
    <Id>1</Id>
    <IsDefault>true</IsDefault>
    <LongName>sample string 6</LongName>
    <MediumName>sample string 5</MediumName>
    <Seconds>1</Seconds>
    <ShortName>sample string 4</ShortName>
  </UnitViewModel>
</ArrayOfUnitViewModel>