const datapoints = await client.datapoints.retrieveLatest([
{
before: 'now',
id: 123
},
{
externalId: 'abc',
before: new Date('21 jan 2018'),
}
]);{
"items": [
{
"id": 4503599627370496,
"isString": true,
"type": "<string>",
"datapoints": [
{
"timestamp": 1638795554528,
"value": 123,
"status": {
"code": 123,
"symbol": "<string>"
}
}
],
"externalId": "<string>",
"instanceId": {
"space": "<string>",
"externalId": "<string>"
},
"isStep": true,
"unit": "<string>",
"unitExternalId": "<string>",
"nextCursor": "<string>"
}
]
}Required capabilities:
timeSeriesAcl:READ
Retrieves the latest data point in one or more time series. Note that the latest data point in a time series is the one with the highest timestamp, which is not necessarily the one that was ingested most recently.
const datapoints = await client.datapoints.retrieveLatest([
{
before: 'now',
id: 123
},
{
externalId: 'abc',
before: new Date('21 jan 2018'),
}
]);{
"items": [
{
"id": 4503599627370496,
"isString": true,
"type": "<string>",
"datapoints": [
{
"timestamp": 1638795554528,
"value": 123,
"status": {
"code": 123,
"symbol": "<string>"
}
}
],
"externalId": "<string>",
"instanceId": {
"space": "<string>",
"externalId": "<string>"
},
"isStep": true,
"unit": "<string>",
"unitExternalId": "<string>",
"nextCursor": "<string>"
}
]
}Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.
The list of the queries to perform.
List of latest queries
1 - 100 elementsDescribes the latest query.
Show child attributes
Ignore IDs and external IDs that are not found
A list of responses. Each response contains a list with the most recent data point or an empty list if no data points are found.
The list of responses. The order matches the requests order.
Show child attributes
Was this page helpful?