☰
Login
Signup
Home
›
Market data (WebSockets)
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
14.1K
All Categories
0
Incidents
157
Node JS client
41
Go client
795
.Net API client
385
Kite Publisher
537
.Net / VBA / Excel (3rd party)
463
Algorithms and Strategies
1K
Java client
1.1K
API clients
407
PHP client
4.1K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
In this Discussion
July 2020
sujith
Error 403 while connecting to websocket
mohanarakere
July 2020
in
Market data (WebSockets)
Hi,
I am getting below error while trying to connect websocket server
WebSocket connection to 'wss://ws.kite.trade/?api_key=xxxxxx&access_token=yyyyyyyy' failed: Error during WebSocket handshake: Unexpected response code: 403
What is access_token here, is it api secret key?
Code: Javascript
var socket = new WebSocket(
"wss://ws.kite.trade?api_key=xxxxxxxxx&access_token=yyyyyyyyy");
console.log('onload');
socket.onopen = function(e) {
console.log('on Opne');
alert("[open] Connection established");
alert("Sending to server");
var message = {
"a" : "subscribe",
"v" : [ 408065, 884737 ]
};
ws.send(JSON.stringify(message))
};
socket.onmessage = function(event) {
console.log(event);
alert(`[message] Data received from server: ${event.data}`)
};
sujith
July 2020
It looks like your session is expired. You need to create a new session and use the new access token.
You can check out the login flow
here
.
Sign In
or
Register
to comment.
You can check out the login flow here.