☰
Login
Signup
Home
›
Java 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
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
August 2017
sujith
August 2017
keshavshetty
Always getting com.rainmatter.kitehttp.exceptions.KiteTokenException
keshavshetty
August 2017
in
Java client
I just registred for kite connect and using java to build basic client to experiement.
However I always get KiteTokenException
My code as below
KiteConnect kiteconnect = new KiteConnect(CONSTANTS.API_KEY);
// set userId
kiteconnect.setUserId(CONSTANTS.USER_ID);
// Get login url
String url = kiteconnect.getLoginUrl();
UserModel userModel = kiteconnect.requestAccessToken("request_token", CONSTANTS.SECRET_KEY);
kiteconnect.setAccessToken(userModel.accessToken);
kiteconnect.setPublicToken(userModel.publicToken);
keshavshetty
August 2017
From browser using login url I see below message
error_type "ForbiddenError"
message "The user is not enabled on the app."
status "error"
What next? Contact customer care?
sujith
August 2017
Hi
@keshavshetty
,
Are you sure you are using Kite Connect api_key?
Don't use Kite Publisher's api_key.
sujith
August 2017
@keshavshetty
,
A request token is valid for a couple of minutes and validity is once. The access token is valid for one day.
Once you get access token store it and reuse it, don't call requestAccessToken API for every run.
keshavshetty
August 2017
Hi Sujith,
I am using Kite connect API (Not Publisher)
I was not able to login even once and you say store access token !!!
As per browser url, it is clear that
error_type "ForbiddenError"
message "The user is not enabled on the app."
status "error"
Something need to be enabled in the server side
keshavshetty
August 2017
Thanks Sujith,
It resolved the issue. (I was not populating the request token)
One more question, Everytime we have to use browser to get the request token? (Can we automate that also? (I tried with HttpClient, but didn't work)
sujith
August 2017
Hi
@keshavshetty
,
It is mandatory by the exchange that a trader has to log in at least once a day.
We don't recommend automating login.
This discussion has been closed.
error_type "ForbiddenError"
message "The user is not enabled on the app."
status "error"
What next? Contact customer care?
Are you sure you are using Kite Connect api_key?
Don't use Kite Publisher's api_key.
A request token is valid for a couple of minutes and validity is once. The access token is valid for one day.
Once you get access token store it and reuse it, don't call requestAccessToken API for every run.
I am using Kite connect API (Not Publisher)
I was not able to login even once and you say store access token !!!
As per browser url, it is clear that
error_type "ForbiddenError"
message "The user is not enabled on the app."
status "error"
Something need to be enabled in the server side
It resolved the issue. (I was not populating the request token)
One more question, Everytime we have to use browser to get the request token? (Can we automate that also? (I tried with HttpClient, but didn't work)
It is mandatory by the exchange that a trader has to log in at least once a day.
We don't recommend automating login.