One Trading API
REST APIWebSocket API
REST APIWebSocket API
  1. WebSocket API
  • Introduction
  • Authenticate
  • Subscribe
  • Ping / Pong
  • Trading
    • Introduction
    • Dead Man Switch (Auto Cancellation)
    • Create Order
    • Cancel All Orders
    • Cancel Order by Client ID
    • Cancel Order by Order ID
    • Margin Update
    • Settlement
    • Funding Payment
    • Order Booked
    • Order Rejected
    • Order Closed
    • Trade Executed
    • Order Fully Filled
    • Move Order
    • Balance Adjustment
  • Orderbook
    • Introduction
    • Orderbook Snapshot
    • Orderbook Update
  • Price Ticks
    • Introduction
    • Price Tick
  • Book Ticker
    • Introduction
    • Book Tick
  1. WebSocket API

Authenticate

WebSocket URL:
wss://streams.onetrading.com
All private channels require client authentication before subscription. Clients should first send an AUTHENTICATE message containing the API token, after which they can subscribe to any private channel. If the supplied API token is valid, it will be used to authorize subscriptions and requests for all private channels within this WebSocket connection.
An API token can be generated in the One Trading UI.
You must ensure the API token you generate has the Trade permission, otherwise you will receive an AUTH_ERROR.

Authentication Request#

{
  "type": "AUTHENTICATE",
  "api_token": "eyJ..."
}
AuthenticateRequest

Authentication Response#

Success#

{
  "type": "AUTHENTICATED"
}
AuthenticateSuccessResponse

Error#

{
  "error": "AUTHENTICATION_FAILED"
}
AuthenticateErrorResponse

Previous
Introduction
Next
Subscribe
Built with