Skip to main content
Version: 5.21.0

ChatTransportConfig

ChatTransportConfig describes the mobile SDK's connection parameters to the edna Chat Center backend. It is passed in ChatConfig.transportConfig. The class has two constructors:

  • Single-host constructor (cloudHost) — REST and WebSocket endpoints are derived from a single URL. datastore is left empty, so file upload/download through this config does not work.
  • Extended constructor — REST, WebSocket, and datastore are specified explicitly. Suitable for non-standard deployments and for working with file attachments.

Connection timeouts and SSL pinning are configured separately — see network_config.

Where to get the URL and providerUid

The cloudHost value (or rest / webSocket / dataStore in the extended constructor) and providerUid are available to the edna Chat Center administrator on the Android channel's "Setup" tab. Full path and field structure: Connecting the Android mobile chat.

Single-host constructor​

Accepts a single URL from which the SDK derives the REST and WebSocket base URLs.

val transportConfig = ChatTransportConfig(
cloudHost = "https://name.edna.io", // full URL with protocol
apiVersion = ChatApiVersion.V16 // V16 by default
)
File attachments do not work with this constructor

datastore is not derived from cloudHost — it remains an empty string. If your app uses file upload/download, switch to the extended constructor.

ParameterTypeRequiredDefaultDescription
cloudHostStringYes—Full backend server URL with protocol (https://name.edna.io). A URL without protocol causes an error during SDK initialization
apiVersionChatApiVersionNoV16Backend API version

Available ChatApiVersion values​

ValueAPI versionNote
ChatApiVersion.V1616Default
ChatApiVersion.V1717—
ChatApiVersion.V1818—
ChatApiVersion.V1919—
ChatApiVersion.V2020—
ChatApiVersion.V2121Latest version
Coordinating the version

The API version must be coordinated with edna technical support — it must match the version of your edna Chat Center backend.

Extended constructor​

Used when the app needs file attachments or when REST, WebSocket, and Datastore are hosted on different servers:

val transportConfig = ChatTransportConfig(
rest = "https://rest.example.com",
webSocket = "wss://ws.example.com",
dataStore = "https://datastore.example.com",
dataStoreHTTPHeaders = null, // or mapOf("X-Header" to "value")
apiVersion = ChatApiVersion.V16
)
ParameterTypeRequiredDefaultDescription
restStringYes—REST endpoint URL with protocol (https://...)
webSocketStringYes—WebSocket endpoint URL with protocol (wss://... for TLS, ws://... for unencrypted)
dataStoreStringYes—Datastore URL with protocol (file upload/download)
dataStoreHTTPHeadersMap<String, String>?No—Additional HTTP headers for the datastore. The parameter has no default — pass null if you have no custom headers (the SDK substitutes an empty Map).
newRoutesEnabledBooleanNotrueControls the message-history endpoint path: true — api/client/history, false — legacy path history. Does not affect other endpoints. Set false only if your backend does not support the new path
apiVersionChatApiVersionNoV16Backend API version
URL normalization

The trailing / is handled automatically: for REST and dataStore URLs it is added, for WebSocket it is removed. You can pass URLs with or without the slash. Path and query parameters are preserved as-is.