Yourfintech
Yourfintech
Yourfintech
  • Yourfintech
  • Trading Platform Overview
  • Socket Integration
    • JSON format socket
      • General messages structure
      • Server messages spec
      • Client messages spec
      • Root Models
    • Yft Manager API
      • General messages structure
      • Server message spec
      • Client Messages spec
      • Root Models
  • Trading Platform Integration
    • Account Integration
      • ProtoFile
    • Trading Engine Integration
      • ProtoFile
    • Trading Settings Integration
      • ProtoFile
Powered by GitBook
On this page
  • Overview
  • Message Types
  1. Socket Integration
  2. JSON format socket

General messages structure

PreviousJSON format socketNextServer messages spec

Last updated 7 months ago

Overview

Each message exchanged over the TCP socket is a JSON object adhering to the following general structure:

{
  "message_id": "string",
  "message_type": {
    // Message type content
  }
}
Name
Type
Desc

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:

Message Types

ClientMessage

Represents a message sent from the client to the server. The structure includes client-specific data encapsulated within the object.

{
  "message_id": "string",
  "message_type": {
    "client_message": //client message contract
  }
}

ServerMessage

{
  "message_id": "string",
  "message_type": {
    "server_message": //client message contract
  }
}

Ping

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.

{
  "message_id": "test",
  "message_type": "Ping"
}

Pong

A response to a Ping message, indicating that the sender is active and the connection is alive.

{
  "message_id": "test",
  "message_type": "Pong"
}

Represents a message sent from the server to the client. This message type contains server-specific data within the object.

ClientMessage
ServerMessage
YftIntegrationMessageType