Hello, I recently subscribed to Zerodha Kite API and created a new app. However, when I try to authenticate my API key and generate a session, I get the following error:
{ "status": "error", "message": "Missing or empty field `api_key`", "data": null, "error_type": "InputException" }
### My API Details: - **Zerodha Client ID:** JC1404 - **API App Name:** Bank Nifty Auto Trader - **API Key:**
### Steps I Have Already Tried: ✅ Checked and correctly passed the API Key in my Python script. ✅ Reinstalled the `kiteconnect` library. ✅ Created a new API app and used the new API Key. ✅ Tested on both **Google Cloud & Laptop**, but still getting the same error. ✅ Verified that the API Key is active and has no extra spaces.
**Can someone help me resolve this issue? Is there anything wrong with my API activation or authentication setup?** Thanks in advance!
^ for the same script with your api_key but with placeholder request token and secret I get "kiteconnect.exceptions.TokenException: Token is invalid or has expired." which is the right error response for invalid secret or request token.
@anandtiwari25, Everything is looks fine, except don't use kite.zerodha.com domain as redirect url. That also results in throwing error as Token is invalid or has expired.
```
from kiteconnect import KiteConnect
kite = KiteConnect(api_key="xxxxx")
data = kite.generate_session("request_token_here", api_secret="your_secret")
print(data)
```
Everything is looks fine, except don't use kite.zerodha.com domain as redirect url. That also results in throwing error as
Token is invalid or has expired
.