In this article
Sample Pagination
Users of the Timeseries API can use pagination to read a subset of the available data. Samples, by default, are separated into pages of 100 and the user receives a continuation token that they must use to get the next set of samples. Users can modify the page size by using the ‘limit’ query parameter (see URL parameters). Pages are limited to a maximum of 1000 samples per page.
ContinuationToken = {“token”:”+RID:qUB+AP5BWAAaAgAAAAAAAA==#RT:2#TRC:200#RTD:GGrCdc/Zt+CA#FPC:AgEAAAAWABICwP8A/LNAyWkCACAAXoACwEGYBQA=”,”range”:{“min”:””,”max”:”05C1B9CD673390″}}
URL
https://{{HOST}}/timeseries/timeseries/{timeseries_id}/samples?paginated=true
Method
GET
Required IMS Scopes
- Read
- Write
Required ACL Permissions
- owner
- admin
- readwrite
- readonly
Versions Supported
- 2.0 (Default)
- 2.1
URL Path Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| timeseries_id required |
Timeseries ID to get statistics for | GUID | string |
URL Query Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| v optional |
Version of the API to use | v=2.0 | string |
| paginated optional |
Specifies whether or not to enable pagination. Without this parameter, pagination is turned off. | true | boolean |
| startTime optional |
Starting time of the target period | 2018-01-01T00:00:00+00:00 | ISO 8601 string(date-time + offset) |
| endTime optional |
Ending time of the target period | 2018-12-31T23:59:59+00:00 | ISO 8601 string(date-time + offset) |
| limit optional |
Limit the number of samples returned to this number (Max: 1000) | 1 | integer(int32) |
| metric optional |
Metric from which to query the samples | Raw | string |
| orderby optional |
Order the returned samples based on the element provided. Provide one of the fields in the sample JSON space-seperated by asc/desc to choose an ascending or descending order | timestamp desc | string |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authentication | Bearer {access_token} required |
Retrieve access token |
| Content-Type | application/json required |
Description |
| NextPageSampleLink | The continuation token provided by the query response (See Example). By default, the query returns the first 100 samples |
Example
Request
curl -X GET
'https://{{HOST}}/timeseries/5d33771d-d87a-4635-9af9-3998744ae33f/samples?paginated=true'
-H 'Authorization: Bearer {access_token}'
-H 'Cache-Control: no-cache'
-H 'NextPageSampleLink: {"token":"+RID:qUB+AP5BWAAaAgAAAAAAAA==#RT:2#TRC:200#RTD:GGrCdc/Zt+CA#FPC:AgEAAAAWABICwP8A/LNAyWkCACAAXoACwEGYBQA=","range":{"min":"","max":"05C1B9CD673390"}}'
Response
{
"samples": [
...
{
"unixTimestamp": 1498919861000,
"ingestUnixTimestamp": 1500055266009,
"timestamp": "2017-07-01T14:37:41+00:00",
"timeOffset": "+00:00",
"val": 57,
"timeseriesId": "680b2cc4-81ce-4eb7-94c8-260e641f065f",
"metric": "Raw"
},
{
"unixTimestamp": 1498914452000,
"ingestUnixTimestamp": 1500055266009,
"timestamp": "2017-07-01T13:07:32+00:00",
"timeOffset": "+00:00",
"val": 7,
"timeseriesId": "680b2cc4-81ce-4eb7-94c8-260e641f065f",
"metric": "Raw"
}
],
"nextPageContinuationToken": "{"token":"+RID:qUB+AP5BWAAaAgAAAAAAAA==#RT:2#TRC:200#RTD:GGrCdc/Zt+CA#FPC:AgEAAAAWABICwP8A/LNAyWkCACAAXoACwEGYBQA=","range":{"min":"","max":"05C1B9CD673390"}}"
}
Errors
| Error | Description |
|---|---|
| 403 | Forbidden |
Response Body Parameters
| Name | Description | Schema |
|---|---|---|
| samples | List of samples | Array |
| nextPageContinuationToken | Continuation Token | string |