GET api/v1/devices/{deviceId}/measurements/channel/{channel}/field/{field}?startDate={startDate}&endDate={endDate}&limit={limit}&sortOrder={sortOrder}&aggregation={aggregation}

Get measurements for the specified device field. NB: This uses a different route to fit in better with the /devices/id/... format. If the device allows anonymous access this method will return the measurements without the need for authentication.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
deviceId

The device's Id.

globally unique identifier

Required

channel

The measurements channel.

integer

Required

field

The field.

string

Required

startDate

Read results starting from this date.

string

Default value is

endDate

The end date of the results to read.

string

Default value is

limit

How many results to request. This is limited to 1000 maximum. Start and End date should be used for pagination

integer

Default value is 1000

sortOrder

Sort order. Asc or Desc

SortOrder

Default value is Asc

aggregation

Not supported yet. Options: None, Auto, Hourly, Daily, Weekly. Auto aggregates if large number of results.

MeasurementsAggregation

Default value is None

Body Parameters

None.

Response Information

Resource Description

SenMlMeasurementListDto
NameDescriptionTypeAdditional information
e

Collection of SenMlMeasurementDto

None.

bt

Base time offset for fields

integer

None.

bn

Base name for field names

string

None.

bu

Base unit

string

None.

ver

Version

integer

None.

Response Formats

application/json, text/json, application/senml+json

Sample:
{
  "e": [
    {
      "n": "sample string 1",
      "u": "sample string 2",
      "v": 1.0,
      "sv": "sample string 3",
      "bv": true,
      "s": 1.0,
      "t": 4.1,
      "ut": 1
    },
    {
      "n": "sample string 1",
      "u": "sample string 2",
      "v": 1.0,
      "sv": "sample string 3",
      "bv": true,
      "s": 1.0,
      "t": 4.1,
      "ut": 1
    }
  ],
  "bt": 1,
  "bn": "sample string 2",
  "bu": "sample string 3",
  "ver": 4
}

application/xml, text/xml

Sample:
<SenMlMeasurementListDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AnalysisUK.Tinamous.www.ApiControllers.Models.Measurements">
  <bn>sample string 2</bn>
  <bt>1</bt>
  <bu>sample string 3</bu>
  <e>
    <SenMlMeasurementDto>
      <bv>true</bv>
      <n>sample string 1</n>
      <s>1</s>
      <sv>sample string 3</sv>
      <t>4.1</t>
      <u>sample string 2</u>
      <ut>1</ut>
      <v>1</v>
    </SenMlMeasurementDto>
    <SenMlMeasurementDto>
      <bv>true</bv>
      <n>sample string 1</n>
      <s>1</s>
      <sv>sample string 3</sv>
      <t>4.1</t>
      <u>sample string 2</u>
      <ut>1</ut>
      <v>1</v>
    </SenMlMeasurementDto>
  </e>
  <ver>4</ver>
</SenMlMeasurementListDto>