I am able to successfully generate the session and authenticate using the API credentials. Order placement and other API operations are working as expected.
However, when I create a ticker instance, register the event handlers (OnConnect, OnTick, OnOrderUpdate, etc.), and call Connect(), the connection fails and the OnError event is triggered every time.
Error Details:
* Event Triggered: OnError * Error Message: "Error while connecting. Message: The server returned status code '403' when status code '101' was expected."
Additional Information:
* The same code and configuration work correctly with my account. * The issue occurs only with my friend account. * We have verified that the correct user credentials are being used. * Session generation is successful. * Orders can be placed successfully through the API. * Only the WebSocket/Ticker connection fails, preventing events such as OnOrderUpdate from being received.
Could you please check whether there are any account-level restrictions, WebSocket access issues, or configuration mismatches for this account?
The 403 Forbidden error you are encountering appears to be because you are using a Kite Personal app (free version). Kite Personal apps do not provide access to market data APIs, historical data APIs, or WebSocket streaming.
To verify this, please login to the Developer Console and check the type of app that has been created under your account.
Additionally, please ensure that:
You have created a Kite Connect (Connect) app with an active subscription.
The api_key being used in your application belongs to the subscribed Kite Connect app and not the Personal app.
The access token has been generated using the same api_key.
Note: Please avoid sharing API key and client-specific tokens on any public forum.
To verify this, please login to the Developer Console and check the type of app that has been created under your account.
Additionally, please ensure that:
- You have created a Kite Connect (Connect) app with an active subscription.
- The api_key being used in your application belongs to the subscribed Kite Connect app and not the Personal app.
- The access token has been generated using the same api_key.
Note: Please avoid sharing API key and client-specific tokens on any public forum.