☰
Login
Signup
Home
›
Node JS client
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
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
458
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
August 2022
SRIJAN
Not able to connect to the api
sanjays442
August 2022
edited August 2022
in
Node JS client
var KiteConnect = require("kiteconnect").KiteConnect;
var kc = new KiteConnect({
api_key: "your_api_key"
});
kc.generateSession("request_token", "api_secret")
.then(function(response) {
init();
})
.catch(function(err) {
console.log(err);
})
function init() {
// Fetch equity margins.
// You can have other api calls here.
kc.getMargins()
.then(function(response) {
// You got user's margin details.
}).catch(function(err) {
// Something went wrong.
});
}
{
status: 'error',
message: 'Token is invalid or has expired.',
data: null,
error_type: 'TokenException'
}
I'm using this code to connect but it is showing Token expired. Please let me know what is wrong
SRIJAN
August 2022
A request token is valid only for a couple of minutes, after that it expires.
Make sure to use your request token immediately after logging in to your KiteConnect app.
SRIJAN
August 2022
You need to have a KiteConnect app to use the KiteConnect APIs.
When you create this,you will get both api_key and api_secret.
After that,you have to login as told here:
https://kite.trade/docs/connect/v3/user/#login-flow
A KitePublisher app only allows you to place orders.
Sign In
or
Register
to comment.
Make sure to use your request token immediately after logging in to your KiteConnect app.
When you create this,you will get both api_key and api_secret.
After that,you have to login as told here:
https://kite.trade/docs/connect/v3/user/#login-flow
A KitePublisher app only allows you to place orders.