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
  • Structure
  • Message Type
  • Basic structure of ClientMessage
  • Basic structure of Success ServerMessage
  • Basic structure of Error ServerMessage
  • Basic structure of Ping
  • Basic structure of Pong
  1. Socket Integration
  2. Yft Manager API

General messages structure

Each message exchanged over the TCP socket in YFT Manager API is a JSON object with the following general structure:

{
  "message_id": "string",
  "message_response_id": "string | null",
  "message_type": {
    // See one of the message types
  }
}

Structure

Name
Type
Description

message_id

String

Unique identifier for the message. Used to trace or correlate requests and responses. Required for every message.

message_response_id

String (optional)

Refers to the original message_id in case this is a response to a client's request.

message_type

YftManagerApiMessageType

The actual type of the message. Defines the content and behavior.

Message Type

The message_type field is an enum and can be one of:

  • ClientMessage — describes client-initiated messages (requests). See details on the Client messages spec page.

  • ServerMessage — describes server responses and updates. See details on the Server messages spec page.

  • Ping — heartbeat ping from the client.

  • Pong — heartbeat pong from the server.

Expamples:

Basic structure of ClientMessage

{
  "message_id": "string",
  "message_response_id": "string | null",
  "message_type": {
    "client_message": {
      // One of client messages, e.g. { "auth_request": { "secret_key": "..." } }
    }
  }
}

Basic structure of Success ServerMessage

{
  "message_id": "string",                    // Unique message ID (UUID)
  "message_response_id": "string | null",   // Optional: links response to original request
  "message_type": {
    "server_message": {
      "success": {
        "<payload_key>": {
          "<event_type>": {
            "data": [ /* array of domain objects */ ]
          }
        }
      }
    }
  }
}

Basic structure of Error ServerMessage

{
  "message_id": "string",
  "message_response_id": "string | null",
  "message_type": {
    "server_message": {
      "error": "unauthorized"
    }
  }
}

Basic structure of Ping

{
  "message_id": "string",
  "message_response_id": "string | null",
  "message_type": "ping"
}

Basic structure of Pong

{
  "message_id": "string",
  "message_response_id": "string | null",
  "message_type": "pong"
}
PreviousYft Manager APINextServer message spec

Last updated 4 days ago

See more detail on for full list of supported <payload_key> and <event_type> values.

ServerMessage