Page tree
Skip to end of metadata
Go to start of metadata

Introduction

The Streaming APIs give developers low latency access to stream of data. A proper implementation of a streaming client will be pushed messages indicating quotes, order, positions and other events have occurred, without any of the overhead associated with polling a REST endpoint.

Connecting

To create a new connection to the streamer following conditions must be satisfied:

  • User should be authorized in the system.
  • Session ID should be valid.
  • User ID should be valid.

Request

GET <URL>?User=<UserID>:<SessionID>&Password=<StreamerSessionID>&HttpClientType=WebSocket

Example: ws://etnatrader.etnasoft.us:9999/CreateSession.txt?User=1143:dc57b831-3ad9-49df-846c-dd3fdd3e75ec&Password=dc57b831-3ad9-49df-846c-dd3fdd3e75ec&HttpClientType=WebSocket

UserId and SessionId can be retreived from login rest service call. See REST API Walkthroughs for details.

ParamJSON KeyDescription
UserIDResult.UserIdUser's identifier
SessionIDResult.SessionIDUser's session identifier
StreamerSessionID

For trade data streamer: Result.DataAddresses.SessionID

For quote data streamer: Result.QuoteAddresses.SessionID

Session identifier for the target streamer.

 

Response

ParamDescription
CmdCreateSession.txt
StatusCodeConnection Status
SessionIDUser's session identifier

Example: {"Cmd":"CreateSession.txt""StatusCode":"Ok""SessionId":"6210cb85-c6bb-44f1-a53b-0e43669bd6f4" }

Example 2: {"Cmd":"CreateSession.txt""StatusCode":"Error"}

Subscribe/Unsubscribe

Used for start/stop receiving data changes. Once applications subscribe to a streaming endpoint, they are delivered a feed of data, without needing to worry about polling or REST API rate limits.

ParamTypeDescription
CmdStringCommand
SessionIdStringUser's session identifier
KeysStringone or few subscription keys, in a case of multiple keys they should be separated by “;”
EntityTypeString

entity type identificator, equals to key property from entity definition section on streamer side.

HttpClientTypeStringtype of client.

Endpoints

Examples

 

 

  • No labels