Skip to content

GET /api/history/temperature/samples/?page=1&pageSize=2&direct=desc

Get a page of synchronized history samples for all four channels.

Auth: Bearer.


ParameterTypeRequiredDefaultDescription
pagenumberno*—Page number, starting at 1. Used only in the first request in a series. Ignored if cursor is provided.
pageSizenumberyes—Number of samples per page. Valid range: 1..20.
directstringno"desc"Sort direction: "asc" — oldest to newest; "desc" — newest to oldest.
cursornumberno*—Cursor for continuing the query. See below.

*Either page or cursor is required.

The cursor provides stable sequential pagination without duplicates or gaps.

  • First request in a series: the client sends page=1 and omits cursor. The server starts the query at lastSequence (desc) or oldestSequence (asc).
  • Response contains nextCursor, the position from which to continue.
  • Subsequent requests: the client sends the cursor from the previous response; page is ignored.
  • End of the query: nextCursor: null means that no more data is available.
  • New series (when navigating to another UI page): the client resets cursor and starts again with page=1.

{
"nextCursor": 1234,
"periodSec": 5,
"lastSequence": 1236,
"samples": [
{
"sequence": 1236,
"channels": [
{ "state": "normal", "temperature": 72.5 },
{ "state": "normal", "temperature": 72.7 },
{ "state": "invalid", "temperature": null },
{ "state": "normal", "temperature": 68.2 }
]
},
{
"sequence": 1235,
"channels": [
{ "state": "normal", "temperature": 72.4 },
{ "state": "normal", "temperature": 72.6 },
{ "state": "invalid", "temperature": null },
{ "state": "normal", "temperature": 68.1 }
]
}
],
"sampleCount": 2
}
FieldTypeDescription
nextCursornumber|nullCursor for the next request. null if the end of the query has been reached.
periodSecnumberHistory recording interval in seconds.
lastSequencenumberCurrent monotonic sequence number at the time of the request.
samplesarraySamples in direct order (0..pageSize elements).
sampleCountnumberNumber of samples in the current result set.

If no more data is available, the response contains sampleCount: 0, samples: [], and nextCursor: null. This is not an error.

FieldTypeDescription
sequencenumberSequence number of this sample.
channelsarray4 elements (CH1..CH4).
FieldTypeDescription
statestring"normal", "open", "short", "invalid"
temperaturenumber|nullTemperature (null if invalid)

Scenario: populate a 60-sample UI window (3 requests of 20)

Section titled “Scenario: populate a 60-sample UI window (3 requests of 20)”
GET /api/history/temperature/samples/?page=1&pageSize=20&direct=desc
→ { "nextCursor": 1216, "sampleCount": 20, "samples": [...] }
GET /api/history/temperature/samples/?cursor=1216&pageSize=20&direct=desc
→ { "nextCursor": 1196, "sampleCount": 20, "samples": [...] }
GET /api/history/temperature/samples/?cursor=1196&pageSize=20&direct=desc
→ { "nextCursor": null, "sampleCount": 20, "samples": [...] }

The first request uses page=1; subsequent requests use the cursor from the previous response.