Always getting KiteTokenException error while requesting accessToken

krtrader
I am trying to initialize KiteConnect object using Java client.
Below is the code:
KiteConnect kiteConnect = new KiteConnect(Constants.API_KEY);
kiteConnect.setUserId(Constants.ZERODHA_ID);

try {
UserModel userModel = kiteConnect.requestAccessToken("pa7kvbrdtzgpptnturi2kyzne0ew3ye7", Constants.API_SECRET);
kiteConnect.setAccessToken(userModel.accessToken);
kiteConnect.setPublicToken(userModel.publicToken);

} catch (KiteException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}

I am getting below error:
com.rainmatter.kitehttp.exceptions.KiteTokenException
at com.rainmatter.kitehttp.KiteRequest.dealWithKiteException(KiteRequest.java:255)
at com.rainmatter.kitehttp.KiteRequest.postRequest(KiteRequest.java:51)
at com.rainmatter.kiteconnect.KiteConnect.requestAccessToken(KiteConnect.java:181)

Please help. I have sent message for API KEY
This discussion has been closed.