Sync records from a stream

Required capabilities: StreamRecordsAcl:READ DataModelsAcl:READ

Subscribe to changes for records from the stream, matching a supplied filter.

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

Change filter specification.

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

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

(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.

cursor
string [ 1 .. 100000 ] characters

A cursor returned from the previous sync request.

initializeCursor
string [ 6 .. 100 ] characters

The format is "duration-ago", where duration is a correct duration representation: 3m, 400h, 25d, etc. For instance, "2d-ago" will give a stream of changes ingested up to 2 days ago.

If cursor is not set, initializeCursor is used to choose a shift where to start the stream reading. If initializeCursor is not set, the cursor is required. If the cursor is provided, initializeCursor is ignored.

Note that initializeCursor is not exact; a deviation up to few seconds can occur.

limit
integer [ 1 .. 1000 ]
Default: 10

Limits the number of results to return.

Responses
200

The next chunk of matching the filter records starting from the cursor in the request.

Note: The maximum total response size is 10MB.

400

The response for a failed request.

post/streams/{streamId}/records/sync
Request samples
application/json
{
  • "sources": [
    • {
      }
    ],
  • "filter": {
    • "and": [
      ]
    },
  • "cursor": "c29tZSBjdXJzb3I=",
  • "initializeCursor": "42d-ago",
  • "limit": 42
}
Response samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "nextCursor": "c29tZSBjdXJzb3I=",
  • "hasNext": true
}