It looks like you're new here. If you want to get involved, click one of these buttons!
import { configurationFile } from "../lib/config";
import { getEnv } from "../lib/env";
var KiteConnect = require("kiteconnect").KiteConnect;
var kc = new KiteConnect({
api_key: configurationFile[getEnv("NODE_ENV")].kiteConnect.apiKey
});
kc.generateSession("XUhsHTqWQ7pmYd9Q0Scjy5to4jUPdqvg", configurationFile[getEnv("NODE_ENV")].kiteConnect.apiKey)
.then(function(response) {
console.log(response)
})
.catch(function(err) {
console.log(err);
});
I am getting this response as an error last three days = {
"status": "error",
"message": "Invalid `checksum`.",
"data": null,
"error_type": "TokenException"
}
The generateSession method takes request_token and api_secret. You can check out examples here.
I tried whatever suggest in official doc
and I regenerate api_secret also again and put that in config file also
but still same issue I am facing from long time that invalid checksum
`import { configurationFile } from "../lib/config";
import { getEnv } from "../lib/env";
var KiteConnect = require("kiteconnect").KiteConnect;
var kc = new KiteConnect({
api_key: configurationFile[getEnv("NODE_ENV")].kiteConnect.apiKey
});
kc
.generateSession(
"XUhsHTqWQ7pmYd9Q0Scjy5to4jUPdqvg",
configurationFile[getEnv("NODE_ENV")].kiteConnect.apiSsecret
)
.then(function(response) {
console.log(response);
})
.catch(function(err) {
console.log(err);
});`
you can check the new code I put new secret key in config file also but result is still same
import { configurationFile } from "../lib/config";
import { getEnv } from "../lib/env";
var KiteConnect = require("kiteconnect").KiteConnect;
var kc = new KiteConnect({
api_key: configurationFile[getEnv("NODE_ENV")].kiteConnect.apiKey
});
kc
.generateSession(
"XUhsHTqWQ7pmYd9Q0Scjy5to4jUPdqvg",
configurationFile[getEnv("NODE_ENV")].kiteConnect.apiSecret
)
.then(function(response) {
console.log(response);
})
.catch(function(err) {
console.log(err);
});
generateSession
function instead of getting from env?