API error: API call not allowed for the authenticated uer

mxplusb
Hello,

Publishing the issue here as per the request from Zerodha support.

Through developer dashboard I have created an App, its Connect + Publisher.

I am using https://github.com/rainmattertech/kiteconnectjs for initial testing.

After obtaining the request token via login flow and using it in the sample code, I get this error:




Might be related to this issue I found on the forum...

https://zerodha.net/forum/discussion/comment/6321/

Nothing really in the code:

var KiteConnect = require("kiteconnect").KiteConnect;

var kc = new KiteConnect("<my-api-key>");

kc.requestAccessToken("request-token-from-login-flow", "my-api-secret")
.then(function(response) {
init();
})
.catch(function(err) {
console.log(err.response);
})

function init() {
// Fetch equity margins.
// You can have other api calls here.

kc.instruments("NSE") //or kc.margins("equity")
.then(function(response) {
// You got user's margin details.
}).catch(function(err) {
// Something went wrong.
});
}
Pointers appreciated. Thank you.
Tagged:
This discussion has been closed.