I just acquired a kite developer account. I am trying to connect to kite using the code below.
downloaded kiteconnectjs from
https://github.com/zerodhatech/kiteconnectjs var KiteConnect = require("kiteconnect").KiteConnect;
var kc = new KiteConnect({
api_key: "api_key"
});
kc.generateSession("request_token", "api_secret")
.then(function(response) {
init();
})
.catch(function(err) {
console.log(err);
});
function init() {
kc.getMargins()
.then(function(response) {
})
.catch(function(err) {
});
}
However during generateSession call it is failing with the following exception
{ status: 'error',
message: 'Token is invalid or has expired.',
data: null,
error_type: 'TokenException' }
I am replacing api_key and api_secret with the corresponding key and secret of my app
Do we need to replace the "request_token" value passed in generateSession and if YES how do we generate the value.
June 2018