Not able to login to kite connect to get access token for API access

jayammahm
Dear,

I recently subscribed to Kite Connect API and when I tried to login using the below URL, got invalid api_key error.
https://kite.zerodha.com/connect/login?api_key=4ny8th7jqeb7k2yk&v=3

{"status":"error","message":"Invalid `api_key`","data":null,"error_type":"InputException"}
  • sujith
    Are you sure, your api key is correct? Did you copy the api key?
    Are you sure your app is not deleted?
  • bdvk
    If I accidentally delete the APP, will I be allowed to recreate a new APP within the 30 day period without paying Rs.2000 again.
  • rakeshr
    @bdvk
    For all payment related query, you need to write to talk(at)rainmatter.com
  • alokkumar10
    use axios
  • alokkumar10
    alokkumar10 edited July 29
    use axios and crypto package in nodejs

    function generateAccessToken() {
    var lengthKite = api_key + request_token + secret;
    var hashSHA256 = crypto.createHash('sha256').update(lengthKite).digest('hex');

    const requestBody =
    "api_key=" + api_key + "&" + "request_token=" + request_token + "&" + "checksum=" + hashSHA256;

    const config = {
    headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
    }
    }

    axios.post('https://api.kite.trade/session/token', requestBody, config)
    .then(res => {
    var resp = res.data;
    console.log(resp);

    access_token = resp.data.access_token;
    console.log("access token is: ", access_token);
    })
    .catch(err => console.log('error ', err.request.data));
    }
Sign In or Register to comment.