---
updatedAt: 2025-05-19T20:07:28.000Z
agentTools:
  projectIndex: https://developer.ayyeka.com/llms.txt
---

# getSamplesScalarBatchByStream sample

Get Batch of Recent SamplesScalar of a Stream

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "RESTAPI Service",
    "description": "RESTful API",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://restapi.ayyeka.com/v2.0"
    }
  ],
  "paths": {
    "/stream/{streamId}/sample/batch": {
      "get": {
        "tags": [
          "sample"
        ],
        "summary": "getSamplesScalarBatchByStream sample",
        "description": "Get Batch of Recent SamplesScalar of a Stream",
        "operationId": "sample#getSamplesScalarBatchByStream",
        "parameters": [
          {
            "name": "streamId",
            "in": "path",
            "description": "ID of the stream whose recent samples should be returned",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "ID of the stream whose recent samples should be returned",
              "example": 123,
              "minimum": 1,
              "format": "int64"
            },
            "example": 123
          },
          {
            "name": "sampleDate",
            "in": "query",
            "description": "The sampling date and time of the oldest sample in the batch (Unix time, seconds since January 1, 1970 UTC.)",
            "allowEmptyValue": true,
            "required": true,
            "schema": {
              "type": "integer",
              "description": "The sampling date and time of the oldest sample in the batch (Unix time, seconds since January 1, 1970 UTC.)",
              "example": 1582409385,
              "minimum": 946688461,
              "format": "int64"
            },
            "example": 1582409385
          }
        ],
        "responses": {
          "200": {
            "description": "OK response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoredSampleScalarBatch"
                },
                "example": {
                  "hasMore": true,
                  "samples": [
                    {
                      "id": 123,
                      "sample_date": "1995-09-19T15:35:20Z",
                      "stream_id": 24,
                      "value": "102.0000"
                    },
                    {
                      "id": 123,
                      "sample_date": "1995-09-19T15:35:20Z",
                      "stream_id": 24,
                      "value": "102.0000"
                    },
                    {
                      "id": 123,
                      "sample_date": "1995-09-19T15:35:20Z",
                      "stream_id": 24,
                      "value": "102.0000"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "bad_request: Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "not_found: Sample not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests: Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          },
          "500": {
            "description": "internal_server_error: System error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unauthorized"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt_header_Authorization": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "StoredSampleScalar": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID is the unique id of the sample.",
            "example": 123,
            "format": "int64"
          },
          "sample_date": {
            "type": "string",
            "description": "Sample date",
            "example": "1971-04-25T19:06:16Z",
            "format": "date-time"
          },
          "stream_id": {
            "type": "integer",
            "description": "Stream ID",
            "example": 24,
            "minimum": 1,
            "format": "int64"
          },
          "value": {
            "type": "string",
            "description": "Value",
            "example": "102.0000"
          }
        },
        "example": {
          "id": 123,
          "sample_date": "1993-02-20T05:06:15Z",
          "stream_id": 24,
          "value": "102.0000"
        },
        "required": [
          "id",
          "stream_id",
          "sample_date",
          "value"
        ]
      },
      "StoredSampleScalarBatch": {
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "The value is set to true if there is more samples to retrieve",
            "example": true
          },
          "samples": {
            "$ref": "#/components/schemas/StoredSampleScalarCollection"
          }
        },
        "example": {
          "hasMore": true,
          "samples": [
            {
              "id": 123,
              "sample_date": "1995-09-19T15:35:20Z",
              "stream_id": 24,
              "value": "102.0000"
            },
            {
              "id": 123,
              "sample_date": "1995-09-19T15:35:20Z",
              "stream_id": 24,
              "value": "102.0000"
            },
            {
              "id": 123,
              "sample_date": "1995-09-19T15:35:20Z",
              "stream_id": 24,
              "value": "102.0000"
            }
          ]
        },
        "required": [
          "hasMore",
          "samples"
        ]
      },
      "StoredSampleScalarCollection": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/StoredSampleScalar"
        },
        "example": [
          {
            "id": 123,
            "sample_date": "1995-09-19T15:35:20Z",
            "stream_id": 24,
            "value": "102.0000"
          },
          {
            "id": 123,
            "sample_date": "1995-09-19T15:35:20Z",
            "stream_id": 24,
            "value": "102.0000"
          },
          {
            "id": 123,
            "sample_date": "1995-09-19T15:35:20Z",
            "stream_id": 24,
            "value": "102.0000"
          }
        ]
      },
      "Unauthorized": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Message of error",
            "example": "incorrect credentials"
          },
          "request_id": {
            "type": "string",
            "description": "Request ID",
            "example": "uGv69FKl"
          }
        },
        "description": "Unauthorized",
        "example": {
          "message": "incorrect credentials",
          "request_id": "uGv69FKl"
        },
        "required": [
          "request_id",
          "message"
        ]
      }
    },
    "securitySchemes": {
      "jwt_header_Authorization": {
        "type": "http",
        "description": "Secures endpoint by requiring a valid JWT token retrieved via the signin endpoint.",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "sample"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```