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
    • 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
type
enum<string> 
required
Allowed value:
AUTHENTICATE
api_token
string 
required
API token generated on the UI with Trade permissions

Authentication Response#

Success#

{
  "type": "AUTHENTICATED"
}
AuthenticateSuccessResponse
type
enum<string> 
required
Allowed value:
AUTHENTICATED

Error#

{
  "error": "AUTHENTICATION_FAILED"
}
AuthenticateErrorResponse
error
enum<string> 
required
Allowed value:
AUTHENTICATION_FAILED
Previous
Introduction
Next
Subscribe
Built with