360X
API ReferenceRESTWebsockets
FIXSupportStatusWebsite
API ReferenceRESTWebsockets
FIXSupportStatusWebsite
  1. Websockets
  • Connection
  • Object Definitions
  • Namespaces and Events
API ReferenceRESTWebsockets
FIXSupportStatusWebsite
API ReferenceRESTWebsockets
FIXSupportStatusWebsite
  1. Websockets

Connection

Connection Parameters#

Parameter Details#

ParameterTypeDefaultDescription
authobject-Authentication object containing the token
reconnectionbooleantrueWhether to automatically reconnect
reconnectionAttemptsnumber10Number of reconnection attempts before giving up
reconnectionDelaynumber2000Initial delay between reconnection attempts (ms)
reconnectionDelayMaxnumber10000Maximum delay between reconnection attempts (ms)
transportsarray['websocket']Array of allowed transport methods
forceNewbooleantrueForce a new connection instead of reusing existing
To get the access token please refer to the Authentication page in the 360X API reference section of the documentation.

Establishing Connection#

Connecting to a Single Namespace#

Sandbox
Production

Connecting to Multiple Namespaces#

Sandbox
Production

Event Handling#

Connection Events#

Error Events#

Data Events#

Subscription Response#

{
  "message": "Subscription successful to {namespace}"
}

Clean Disconnection#

Error Handling#

Unhandled Promise Rejections#

Uncaught Exceptions#

Complete Connection Example#

Sandbox
Production

Best Practices#

1.
Always implement reconnection logic
2.
Handle all possible socket events
3.
Implement proper cleanup on application shutdown
4.
Log all errors and connection state changes
5.
Monitor connection health
6.
Implement exponential backoff for reconnection attempts
7.
Clean up event listeners when disconnecting
8.
Handle authentication token expiration
9.
Implement proper error recovery strategies
Modified at 2025-05-05 08:22:20
Next
Object Definitions