Connections
Used to display the list of connected channels and Discords.
After establishing WebSocket connection, you'll receive messages with connection_info action - one for each enabled channel which belongs to supported event sources and one for each connected Discord channel.
Your application should keep the map of connections using connectionIdentifier as a key and the last received payload of connection_info with that connectionIdentifier as a value. The connection should be deleted from that map only after receiving connection_closed with connectionUuid (not a connectionIdentifier) equivalent to the one saved in the value.
You can receive duplicates of exactly the same connection_info messages. You can either ignore them or just follow the rule and overwrite the previous payload in the map of connections.
Also, there can be a case when you will receive a connection_closed message and won't be able to find a connection in the map to delete. This can happen because that connection can be already overwritten by the next one which replaced it. When we need to establish a connection to the same target one more time (let's say chat settings was changed), we will first establish a new one and only then terminate the previous in order to avoid downtime (API will handle event deduplication for you).
Connections have a target which is different for each event source. The full list of target interfaces can be found below.
Connection Errors
You can receive connection_info action with status = 'error'. In that case, reason field will contain error code.
List of possible reasons along with description can be found in the table below.
Most reasons are self-explanatory. Only the most common ones will be provided and explained.
TypeScript Interfaces
TypeScript syntax, new interfaces and fields may be added over time