API DocsRESTData service

GetData

Query data

POST
/api/v1/data

Request Body

application/jsonRequired

queriesarray<object>

startTimestring

Required. The starting timestamp of the data to retrieve. This is an inclusive bound.

Format: "date-time"

endTimestring

Required. The end timestamp of the data to retrieve. This is an exclusive bound.

Format: "date-time"

sampleMsinteger

The rate to sample the returned data at. The data is sampled using LTTB which will return one point approximately every sample_ms milliseconds that retains the shape of the raw data. Sampling is only supported for numeric data types, if sample_ms is provided for non-numeric data, it will be ignored and the full-fidelity data will be returned.

Format: "int64"

pageSizeinteger

The maximum number of channel values to return. The service may return fewer than this value. If unspecified, at most 10,000 values will be returned. The maximum value is 100,000; values above 100,000 will be coerced to 100,000. For variable data types (i.e. string channels), at most page_size elements will be read, or 1MB, whichever occurs first.

Format: "int64"

pageTokenstring

A page token, received from a previous GetData call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to GetData must match the call that provided the page token.

curl -X POST "<API_URL>/api/v1/data" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      {
        "channel": {
          "channelId": "string",
          "runId": "string"
        },
        "calculatedChannel": {
          "channelKey": "string",
          "expression": {
            "channelReferences": {
              "property1": "string",
              "property2": "string"
            },
            "expression": "string",
            "expressionChannelReferences": [
              {
                "channelReference": "string",
                "channelId": "string"
              }
            ]
          },
          "runId": "string",
          "mode": "EXPRESSION_MODE_UNSPECIFIED"
        }
      }
    ],
    "startTime": "2019-08-24T14:15:22Z",
    "endTime": "2019-08-24T14:15:22Z",
    "sampleMs": 0,
    "pageSize": 0,
    "pageToken": "string"
  }'

A successful response.

{
  "nextPageToken": "string",
  "data": [
    {
      "@type": "string",
      "property1": null,
      "property2": null
    }
  ]
}