Retrieve records from a stream

Filter the records from the stream.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
path Parameters
streamId
required
string [ 1 .. 100 ] characters ^[a-z]([a-z0-9_-]{0,98}[a-z0-9])?$

An identifier of the stream where the records are stored.

Example: test1
Request Body schema: application/json
required

Filter records based on the last updated time, on the space and on container(s) properties. The response supports custom sorting. Otherwise, the records in the response are sorted by last updated time.

object (lastUpdatedTime)

Matches records with the last updated time within the provided range. This attribute is mandatory for immutable streams but it's optional for mutable streams. The maximum time interval that can be defined by the attribute is limited by the stream settings. If more data needs to be queried than allowed by the stream settings, it should be done with multiple requests. For example, if stream allows querying up to 1 month of data, but a quarterly report is needed, the solution is to make 3 requests, one for each month, and then aggregate the responses.

The range must include at least a left (gt or gte) bound. It is not allowed to specify two upper or lower bounds, e.g. gte and gt, in the same filter.

gte: Greater than or equal to. gt: Greater than. lte: Less than or equal to. lt: Less than.

Note: lastUpdatedTime is a CDF generated timestamp that marks the moment a record is stored in the API

(boolFilter (and (object) or or (object) or not (object))) or (leafFilter (matchAll (object) or exists (object) or equals (object) or hasData (object) or prefix (object) or range (object) or in (object) or containsAll (object) or containsAny (object))) (filter)

A filter Domain Specific Language (DSL) used to create advanced filter queries.

Note: the max number of nodes in the filter tree is 100 and the max tree depth is 10.

Array of objects (propertiesPerContainer) [ 1 .. 10 ] items

List of containers and their properties which values should be selected for the response.

limit
integer [ 1 .. 1000 ]
Default: 10

Limits the number of results to return.

Array of objects (orderedSortSpecList) [ 1 .. 5 ] items

Ordered list of sorting specifications (property, direction, etc) to sort on.

Responses
200

List of matching records.

Note: The maximum total response size is 20MB.

400

The response for a failed request.

post/streams/{streamId}/records/filter
Request samples
application/json
{
  • "lastUpdatedTime": {
    • "gt": 1705341600000,
    • "lt": "2030-05-15T18:00:00.00Z"
    },
  • "filter": {
    • "and": [
      ]
    },
  • "sources": [
    • {
      }
    ],
  • "limit": 42,
  • "sort": [
    • {
      }
    ]
}
Response samples
application/json
{
  • "items": [
    • {
      }
    ]
}