GET /api/history/temperature/samples/?page=1&pageSize=2&direct=desc
Get a page of synchronized history samples for all four channels.
Auth: Bearer.
Query params
Section titled “Query params”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | no* | — | Page number, starting at 1. Used only in the first request in a series. Ignored if cursor is provided. |
pageSize | number | yes | — | Number of samples per page. Valid range: 1..20. |
direct | string | no | "desc" | Sort direction: "asc" — oldest to newest; "desc" — newest to oldest. |
cursor | number | no* | — | Cursor for continuing the query. See below. |
*Either page or cursor is required.
cursor
Section titled “cursor”The cursor provides stable sequential pagination without duplicates or gaps.
- First request in a series: the client sends
page=1and omitscursor. The server starts the query atlastSequence(desc) oroldestSequence(asc). - Response contains
nextCursor, the position from which to continue. - Subsequent requests: the client sends the
cursorfrom the previous response;pageis ignored. - End of the query:
nextCursor: nullmeans that no more data is available. - New series (when navigating to another UI page): the client resets
cursorand starts again withpage=1.
Response 200
Section titled “Response 200”{ "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}Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
nextCursor | number|null | Cursor for the next request. null if the end of the query has been reached. |
periodSec | number | History recording interval in seconds. |
lastSequence | number | Current monotonic sequence number at the time of the request. |
samples | array | Samples in direct order (0..pageSize elements). |
sampleCount | number | Number 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.
samples[]
Section titled “samples[]”| Field | Type | Description |
|---|---|---|
sequence | number | Sequence number of this sample. |
channels | array | 4 elements (CH1..CH4). |
samples[].channels[]
Section titled “samples[].channels[]”| Field | Type | Description |
|---|---|---|
state | string | "normal", "open", "short", "invalid" |
temperature | number|null | Temperature (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.