Dear team, i am getting error of 403 as token is invalid or expired ,while getting data for ticker data with node js I have both the subscription of historical and api subscription.while accessing to historical data i am getting it easily while accessing to ticker data i am getting error of 403.
Attaching you the code:-- var instrument_token = 3463169;
var KiteTicker = require("./views/scripts/kiteconnect").KiteTicker; var ticker = null;
app.get('/callAPI', function (req, res) {
var request_token = req.query.request_token; //var instrument_token = 3463169;
//if (redirectpage == 'http://localhost:8383/chart') { kc.requestAccessToken(request_token, "*************") .then(function (res) { var access_token = res.data.access_token kc.setAccessToken(access_token); console.log(access_token); var date = dateFormat(Date.now(), "yyyy-mm-dd"); kc.historical(instrument_token, date, date, "minute").then(function (response) { var filename = './views/data/LastTradePrice.json'; var data = response.data.candles; console.log(data); });
}
}) })
ticker = new KiteTicker("Api key", "Client_id", request_token);
In the new version of Kite Ticker, it is mandatory to send a valid access token for connecting to Kite Ticker. You are referring to the old version of Kite Ticker which was deprecated last month.
i have update the code but its not working i am not able to get the tick data but i am getting the historical data in node js do we need to update any package also,if yes then tell me all the step in detail how to do it and which are the package that we need to update .
kindly mention all the detail how to get the tick data with node js.
after updating node js package with npm install kiteconnect i have changed my code as var ticker = new KiteTicker("************", access_token); but even then i am not able to get the tick data as the token is showing is invalid or expired.
ticker = new KiteTicker("Api key", "Client_id", request_token);
10 to 15 days earlier i amn sending the request token only and i am getting the tick data
but now i am not getting the data
and also access token is not invalid
as it is generated every time when i run the application over web
You are referring to the old version of Kite Ticker which was deprecated last month.
then tell me all the step in detail how to do it and which are the package that we need to update .
kindly mention all the detail how to get the tick data with node js.
I am not getting any link.
I am really stuck in between
please help @sujith @tonystark
Check if you have a valid access token.