200-level Full Market Depth WebSocket — ResetWithoutClosingHandshake on every connection

Hi @Hardik @Mohseen_Usmani @Pranita @PravinJ @Pratham_Gada @Poornima @Kushagra_Rohatgi

  • Issue: 200-level depth connections fail consistently. 20-level depth works fine on the same account.

    Connection URL tried:

    • wss://full-depth-api.dhan.co/?token=***&clientId=***&authType=2 (SDK root path)

    • wss://full-depth-api.dhan.co/twohundreddepth?token=***&clientId=***&authType=2 (docs path)

    Both fail identically.

    Subscribe JSON sent after connection:

    {"RequestCode": 23, "ExchangeSegment": "NSE_FNO", "SecurityId": "40977"}
    
    

    Behavior:

    1. WebSocket TCP connection establishes successfully

    2. Subscription JSON sent

    3. Server resets connection after 3-5 seconds with ResetWithoutClosingHandshake (no data frames received)

    4. This repeats on every reconnection attempt (40+ attempts observed)

    Working comparison: 20-level depth (wss://depth-api-feed.dhan.co/twentydepth) connects and receives data for the same instruments without issues.

    Questions:

    1. Is 200-level depth enabled for my account/data plan?

    2. Is the 200-level depth server currently operational?

    3. Are there specific instruments that support 200-level depth vs not?

Hi @Parthiban_Sub ,

We have addressed your query over the email, please check your inbox.

Hi @Shubham_Singh @Hardik ,

We have isolated the root cause of our 2-week depth-200 issue
(Ticket #5519522). The endpoint wss://full-depth-api.dhan.co/
rejects access tokens with tokenConsumerType=“APP” but accepts
tokens with tokenConsumerType=“SELF”.

Tested today (2026-04-28) using your official Python SDK
dhanhq==2.2.0rc1, same script, same SecurityId 74147,
only token source changed:

  • APP token (from POST /app/generateAccessToken, our TOTP flow):
    subscribe accepted, then immediate reset, zero frames.
  • SELF token (from web.dhan.co > Generate Access Token button):
    streamed 1187 depth-200 frames in 30 seconds. Works perfectly.

All 4 other paths (main feed, depth-20, order-update, REST)
work with BOTH token types on the same account at the same minute.
Only depth-200 discriminates.

Three quick questions:

  1. Is APP-token rejection on depth-200 intentional?
  2. Is there a programmatic SELF-mint API?
  3. Does GET /v2/RenewToken preserve tokenConsumerType=SELF?

Happy to share the actual JWTs privately and run any diagnostic.
This is blocking our production rollout. Thanks!

1 Like

Hey @Parthiban_Sub

This has been resolved last week with changes at our end. Yes, as you identified correctly, there was an issue with one of the token types, which we have fixed.

Do let us know in case you are still facing this error. We will connect with you if required.