GET api/v1/devices/{deviceId}/charts/{chartId}/measurements/channel/{channel}/field/{field}?startDate={startDate}&endDate={endDate}&limit={limit}&aggregationThreshold={aggregationThreshold}&rangeType={rangeType}

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

chartId

Reserved for later use. Use Guid.Empty ("00000000-0000-0000-0000-000000000000") for now.

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

None.

aggregationThreshold

How many "buckets" the aggregation should optimise into. Typically this would be at max the x-pixels on the chart

integer

Default value is 500

rangeType

The range type of the chart (i.e. individual points or hourly, daily etc)

ChartDataRangeType

Default value is Points

Body Parameters

None.

Response Information

Resource Description

ChartDataDto
NameDescriptionTypeAdditional information
Fields

Collection of ChartFieldDataDto

None.

Response Formats

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

Sample:
{
  "Fields": [
    {
      "Name": "sample string 1",
      "FieldLabel": "sample string 2",
      "Unit": "sample string 3",
      "ChartColor": "sample string 4",
      "UseSecondAxis": true,
      "ChartAxisOption": 0,
      "Points": [
        [
          1.0,
          2.0
        ],
        [
          1.0,
          2.0
        ]
      ],
      "Statistics": {
        "TotalPoints": 1,
        "Average": 2.0,
        "StandardDeviation": 3.0,
        "Min": 4.0,
        "Max": 5.0,
        "DateRange": {
          "Start": "2024-12-26T05:41:12.2090319+00:00",
          "End": "2024-12-26T05:41:12.2090319+00:00"
        },
        "Sum": 6.0
      }
    },
    {
      "Name": "sample string 1",
      "FieldLabel": "sample string 2",
      "Unit": "sample string 3",
      "ChartColor": "sample string 4",
      "UseSecondAxis": true,
      "ChartAxisOption": 0,
      "Points": [
        [
          1.0,
          2.0
        ],
        [
          1.0,
          2.0
        ]
      ],
      "Statistics": {
        "TotalPoints": 1,
        "Average": 2.0,
        "StandardDeviation": 3.0,
        "Min": 4.0,
        "Max": 5.0,
        "DateRange": {
          "Start": "2024-12-26T05:41:12.2090319+00:00",
          "End": "2024-12-26T05:41:12.2090319+00:00"
        },
        "Sum": 6.0
      }
    }
  ]
}

application/xml, text/xml

Sample:
<ChartDataDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AnalysisUK.Tinamous.www.ApiControllers.Models.DeviceChartsMeasurements">
  <Fields>
    <ChartFieldDataDto>
      <ChartAxisOption>Unknown</ChartAxisOption>
      <ChartColor>sample string 4</ChartColor>
      <FieldLabel>sample string 2</FieldLabel>
      <Name>sample string 1</Name>
      <Points xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:ArrayOfdecimal>
          <d4p1:decimal>1</d4p1:decimal>
          <d4p1:decimal>2</d4p1:decimal>
        </d4p1:ArrayOfdecimal>
        <d4p1:ArrayOfdecimal>
          <d4p1:decimal>1</d4p1:decimal>
          <d4p1:decimal>2</d4p1:decimal>
        </d4p1:ArrayOfdecimal>
      </Points>
      <Statistics>
        <Average>2</Average>
        <DateRange>
          <End>2024-12-26T05:41:12.2090319+00:00</End>
          <Start>2024-12-26T05:41:12.2090319+00:00</Start>
        </DateRange>
        <Max>5</Max>
        <Min>4</Min>
        <StandardDeviation>3</StandardDeviation>
        <Sum>6</Sum>
        <TotalPoints>1</TotalPoints>
      </Statistics>
      <Unit>sample string 3</Unit>
      <UseSecondAxis>true</UseSecondAxis>
    </ChartFieldDataDto>
    <ChartFieldDataDto>
      <ChartAxisOption>Unknown</ChartAxisOption>
      <ChartColor>sample string 4</ChartColor>
      <FieldLabel>sample string 2</FieldLabel>
      <Name>sample string 1</Name>
      <Points xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:ArrayOfdecimal>
          <d4p1:decimal>1</d4p1:decimal>
          <d4p1:decimal>2</d4p1:decimal>
        </d4p1:ArrayOfdecimal>
        <d4p1:ArrayOfdecimal>
          <d4p1:decimal>1</d4p1:decimal>
          <d4p1:decimal>2</d4p1:decimal>
        </d4p1:ArrayOfdecimal>
      </Points>
      <Statistics>
        <Average>2</Average>
        <DateRange>
          <End>2024-12-26T05:41:12.2090319+00:00</End>
          <Start>2024-12-26T05:41:12.2090319+00:00</Start>
        </DateRange>
        <Max>5</Max>
        <Min>4</Min>
        <StandardDeviation>3</StandardDeviation>
        <Sum>6</Sum>
        <TotalPoints>1</TotalPoints>
      </Statistics>
      <Unit>sample string 3</Unit>
      <UseSecondAxis>true</UseSecondAxis>
    </ChartFieldDataDto>
  </Fields>
</ChartDataDto>