Messages
The protocol can connect using various protocols.- WebSockets
 - Server-Sent Events (SSE)
 - Http Streaming
 
- id – Message ID
 - transaction – The Transaction (can be thought of a chat instance). What this looks like for you may vary, it may be a topic or or a customer website visit.
 - session – The session (can be thought of the individual client)
 - seq – Sequence ID
 - ts – Timestamp
 - channel – The channel name: 
USER,AGENT,SYSTEM - type – The message type. eg. 
HAI,TRANSACTION_START,MESSAGE_START. - payload – Custom payload for the data
 
Handshakes
The handsake process is as follows:- The client connects to the server.
 - The client sends a 
HAIcontaining its capabilities and auth credentials. The server validates the auth credentials. - The server sends back a 
HAImessage with its capabilities. The client is now ready to communicate. - The client starts a transaction. With a 
START_TRANSACTIONmessage. The server creates a transaction and sends back the transaction id. - The sever responds with the a 
START_TRANSACTION - The client can then send messages/audio to that transaction.
 - Close the transaction when finished.
 
Authentication & Authorisation
We support a wide range of Authentication protocols. On the client implement this method.{token: "Bearer TOKEN" }. This can be then validated on the server by implementing the method:
null which acts causes the authentication to fail.
MESSAGE for all transactions.
We also set the amount of credits the user has access to, this depends on if flow control has been enabled.
Message History
The server stores a message history for each transaction. Using the javascript SDK this can be accessed withtransaction.getReplayWindow();.
The history size is determined by windowSize (number of messages) and windowTime (duration).