Skip to main content

Get Data As Records Through Get

GET 

/records

Retrieves all data for completed flows that match the given query parameters, returning the results as a list of flattened records.

This endpoint takes nested raw Items (which may come from multiple sessions or flows) and converts them into a single-level dictionary per record. The flattening process transforms nested keys into dot-separated paths, where the flow step ID of each module is used as the second component in the key. When arrays are encountered (for example, when a module returns multiple photos), each element is assigned an index (e.g., ".1", ".2", etc.) to distinguish between values.

Nested JSON Structure Example:

Consider a raw Item with nested data:

{
"created_at": "2025-03-05T14:38:22.903000",
"updated_at": "2025-03-05T14:38:22.903000",
"_id": "67c861de20bb29fb40d2cbbd",
"started_at": "2025-03-05T14:38:10",
"ended_at": "2025-03-05T14:38:20",
"flow_id": "APIDocsFlow1",
"photographing": [
{
"flow_step_id": "picz",
"started_at": "2025-03-05T14:38:15",
"ended_at": "2025-03-05T14:38:20",
"photos": [
{
"date": "2025-03-05T14:38:20",
"url": "https://dimmy.s3.amazonaws.com/66826269369bbc3d56b479ce/67c861dc45b0e6fb32ff2ca1"
}
]
}
],
"barcode_scanning": [
{
"flow_step_id": "barcode",
"started_at": "2025-03-05T14:38:10",
"ended_at": "2025-03-05T14:38:15",
"code": "A0155C35"
}
]
}

In this structure:

The module for barcode scanning uses its flow_step_id ("barcode") to generate keys like:

  • barcode_scanning.barcode.started_at
  • barcode_scanning.barcode.ended_at
  • barcode_scanning.barcode.code

The photographing module (with flow_step_id "picz") returns an array for photos. The photos are flattened as:

  • photographing.picz.photos.1.date
  • photographing.picz.photos.1.url (Additional elements would get suffixes .2, .3, etc.)

Flattened Record Example:

Request: GET /records?limit=1

Response:

[
{
"created_at": "2025-03-05T14:38:22.903000",
"updated_at": "2025-03-05T14:38:22.903000",
"_id": "67c861de20bb29fb40d2cbbd",
"started_at": "2025-03-05T14:38:10",
"ended_at": "2025-03-05T14:38:20",
"flow_id": "APIDocsFlow1",
"photographing.picz.started_at": "2025-03-05T14:38:15",
"photographing.picz.ended_at": "2025-03-05T14:38:20",
"photographing.picz.photos.1.date": "2025-03-05T14:38:20",
"photographing.picz.photos.1.url": "https://dimmy.s3.amazonaws.com/66826269369bbc3d56b479ce/67c861dc45b0e6fb32ff2ca1",
"barcode_scanning.barcode.started_at": "2025-03-05T14:38:10",
"barcode_scanning.barcode.ended_at": "2025-03-05T14:38:15",
"barcode_scanning.barcode.code": "A0155C35",
"scanner_account": "optioryx_admin"
}
]

Request

Responses

Successful Response