Invalid API key or Access Token

akshayp211
Hi team.

I am facing an issue w.r.t. api key or access token.
I subscribed almost 3 hours back, and when I was trying to place the order - i was getting the below error.
kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`
My codes for login and placing order are as below:
kite = KiteConnect(api_key=api_key)
data = kite.generate_session(request_token, api_secret)
kite.set_access_token(data["access_token"])

latest_order = kite.place_order(tradingsymbol=scrip_name, exchange='NSE', quantity=1, transaction_type='BUY',
order_type='LIMIT', product='CNC', validity='DAY', variety='REGULAR', price=price,
tag='BUY NO ' + str(total_buys + 1))
Please help solve or clarify the issue.

Thanks.
This discussion has been closed.