API Configuration

<< Click to Display Table of Contents >>

Raynet One Data Hub > 2025.4 > Administration and User Guide > Advanced Topics > Data API 

API Configuration

Raynet One Data Hub provides configuration options for the Data API that allow administrators to control API behaviour and performance characteristics. These settings are configured in the appsettings.json file located in the application installation directory.

 

API Management Settings

The API management settings are configured within the ApiManagement section of the appsettings.json file.

 

MaxBatchSize

The MaxBatchSize parameter controls the maximum number of rows that can be returned per API call when using the paged query endpoint. This setting allows administrators to balance between response size and API performance based on their infrastructure and requirements.

 

Configuration Details

 

Property

Description

Parameter Name

MaxBatchSize

Data Type

Integer (nullable)

Default Value

10000 (if configured in appsettings.json)

1000 (if not configured)

Valid Range

Positive integers greater than 0

 

Configuration Example

The following example shows how to configure the MaxBatchSize parameter in the appsettings.json file:

 

{

 "ApiManagement": {

 "MaxBatchSize": 10000

 }

}

 

Behaviour

If MaxBatchSize is not configured: The system defaults to a maximum batch size of 1000 rows per API call.

If MaxBatchSize is configured: The configured value becomes the maximum number of rows returned per API call.

If a client requests more rows: API requests with a page_size parameter exceeding the configured maximum will be automatically coerced to the maximum value.

If a client provides invalid values: Zero or negative values for page_size will be coerced to the configured maximum.

 

Usage Example

With the configuration shown above (MaxBatchSize: 10000), the following API request behaviour applies:

 

http://localhost:[PORT]/v1/ResultDatabase/resultTable/paged?tableName=[TABLE_NAME]&page=1&page_size=[PAGE_SIZE]

 

page_size=5000 → Returns 5000 rows (within limit)

page_size=10000 → Returns 10000 rows (at maximum limit)

page_size=15000 → Returns 10000 rows (coerced to maximum)

page_size=0 or page_size=-1 → Returns 10000 rows (coerced to maximum)

 

Performance Considerations

When configuring the MaxBatchSize parameter, consider the following:

 

Larger batch sizes: Reduce the number of API calls needed to retrieve large datasets but increase memory usage and response time per request.

Smaller batch sizes: Result in faster individual responses but require more API calls to retrieve complete datasets.

Network considerations: Very large batch sizes may result in timeout issues on slow or unreliable network connections.

Server resources: Higher batch sizes require more memory on the server to process and serialise the data.

 

Best Practises

Start with default values: Begin with the default configuration and monitor API performance before making adjustments.

Monitor usage patterns: Analyse actual API usage to determine optimal batch sizes for your environment.

Test thoroughly: After changing the configuration, test API performance with realistic workloads.

Document changes: Keep a record of configuration changes and the reasons for them.

Restart required: Changes to appsettings.json require an application restart to take effect.

 

papercliper

Note:

Configuration changes in the appsettings.json file require a restart of the Raynet One Data Hub service or application to take effect. Plan configuration changes during a maintenance window to minimise disruption to API consumers.

 

See Also

Getting Table Data (Paged Query)

Data API

Authentication and Authorization