Java
Configuration
Configure Java authentication, retries, timeouts, headers, and OkHttp
Overview
Configuration is optional. The SDK's defaults are suitable for most integrations, so you only need this guide when you want fine-grained control over behavior such as retries, timeouts, headers, and the underlying HTTP client.
import co.insion.InsionClient;
InsionClient client = InsionClient.builder()
.token("<token>")
.timeout(30)
.maxRetries(2)
.addHeader("X-Application", "community-api")
.build();Keep the API key on a trusted server. Never expose it in client applications, logs, or source control.
The default timeout is 60 seconds and the default retry limit is two. Supply .httpClient(okHttpClient) to control transport behavior and connection pooling.
Per-request options
Overloads accept RequestOptions for a one-off timeout, retry limit, or header:
import co.insion.core.RequestOptions;
client.listRecords(
RequestOptions.builder().timeout(10).maxRetries(0).addHeader("X-Request-ID", "req-123").build()
);How is this guide?