GET api/units/{unitId}

Gets a unit by id.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
unitId

The unit id.

integer

Required

Body Parameters

None.

Response Information

Resource Description

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
}

application/xml, text/xml

Sample:
<UnitViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TelogWebAPI.Models">
  <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>