++Sent decoded: fin=1 opcode=1 data=b’md/subscribeQuote\n1\n{“symbol”: “ESZ2”}\n{“symbol”: “ESZ2”}’
websocket connected
++Rcv raw: b’\x81\x01o’
++Rcv decoded: fin=1 opcode=1 data=b’o’
o
++Rcv raw: b’\x88\x05\x03\xe8Bye’
++Rcv decoded: fin=1 opcode=8 data=b’\x03\xe8Bye’
++Sent raw: b’\x88\x82R\xa1DgQI’
++Sent decoded: fin=1 opcode=8 data=b’\x03\xe8’
Looks like you may be trying an operation before authorizing the socket. Please follow the authorization instructions:
- acquire an access token via REST API (/auth/accessTokenRequest with your API Key credentials in the body)
- open the socket to
wss://md.tradovateapi.com/v1/websocket
. - you should receive an
"o"
frame. This is the open frame and will call theonopen
event. When this message is received send this back to the server via thesocket.send
method, something like this:
jsonBody = {
"name": "yourUserName",
"password": "yourPassword",
"sec": "1234-abcd-...",
...
}
accessTokenResponse = requestAccessToken(jsonBody)
socket.send('authorize\n1\n\n'+accessTokenResponse.accessToken)
I did what you recommended and got this error:
a[{“s”:401,“i”:1,“d”:“"Access is denied"”}]
Is there anything else we need to put in the jsonBody to become authorized?
thanks!
I edited my original response to include the correct information - the JSON body is for the accessTokenRequest, I answered a bit too hastily before. Use parameters listed in JSON body for the /auth/accessTokenRequest REST API operation, then use the accessToken
field from the response in the socket.send
method.
++Sent decoded: fin=1 opcode=1 data=b’md/subscribeQuote\n2\n\n{“symbol”: “ESH3”}’
++Rcv decoded: fin=1 opcode=1 data=b’a[{“s”:200,“i”:2,“d”:{“errorText”:“Symbol is inaccessible”,“errorCode”:“UnknownSymbol”,“mode”:“None”}}]’
I’m getting the same error now too
Has it worked in the past? What data did you subscribe to? I’ve subscribed to Level1 - CME ($4 per month)… looks like others are talking about professional license, though we dont distribute data to others…
I also have level 1 CME. This is my first time trying to use the WebSocket for market data. It seems unlikely that we would need a professional license - unless Tradovate decided to leave it out of the documentation