General messages structure
Last updated
Last updated
Each message exchanged over the TCP socket is a JSON object adhering to the following general structure:
Message id
String
A unique identifier for the message, represented as a string. This ID can be used for tracking messages, correlating requests and responses, or debugging purposes.
Message type
object or string that specifies the type of the message and contains any associated data. The message_type
field can be one of the following:
Represents a message sent from the client to the server. The structure includes client-specific data encapsulated within the object.
The server sends a heartbeat message to check the client's availability. The client must respond with a Pong
message; otherwise, the server may disconnect the client.
A response to a Ping
message, indicating that the sender is active and the connection is alive.
Represents a message sent from the server to the client. This message type contains server-specific data within the object.