Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Get Records From Stream

GET/api/v2/highScale/streams/datasets/{datasetRid}/streams/{streamBranchName}/getRecords
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Get a batch of records from a stream for a given partition. Offsets are ordered from [0, inf) but may be sparse (e.g.: 0, 2, 3, 5). Binary field values are returned as base64-encoded strings. Decode them to retrieve the original bytes.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:streams-read.

Path parameters

datasetRid
string

The Resource Identifier (RID) of a Dataset.

streamBranchName
string

The name of a Branch.

Query parameters

viewRid
string
optional

If provided, this endpoint will only read from the stream corresponding to the specified view RID. If not provided, this endpoint will read from the latest stream on the branch.

Providing this value is an advanced configuration, to be used when additional control over the underlying streaming data structures is needed.

partitionId
string

The ID of the partition to retrieve records from.

startOffset
string
optional

The inclusive beginning of the range to be retrieved. Leave empty when reading from the beginning of the partition.

limit
integer

The total number of records to be retrieved. The response may contain fewer records than requested depending on number of records in the partition and server-defined limits.

preview
boolean
optional

Enables the use of preview functionality.

Response body

GetRecordsResponse
list<RecordWithOffset>

A list of records from a stream with their offsets.

Hide child attributes

Hide child attributes

RecordWithOffset
object

A record retrieved from a stream, including its offset within the partition.

Show child attributes

Show child attributes

Examples

Request

Copied!
1 2 3 curl \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/highScale/streams/datasets/ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da/streams/master/getRecords?viewRid=ri.foundry-streaming.main.view.ecd4f0f6-8526-4468-9eda-14939449ad79&partitionId=0&limit=100&preview=true"

Response

Copied!
1 2 3 4 5 6 7 8 9 [ { "offset": 42, "value": { "timestamp": 1731426022784, "value": "Hello, World!" } } ]

Error responses

Error Name
GetRecordsFromStreamPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not getRecords the Stream.
ParametersdatasetRid, streamBranchName