WEbsocket connection fails with the following error

Dear Upstox Developer Team,

I am developing an algorithmic trading strategy using the Upstox API for real-time trading in the Indian equity market.
I have successfully:

  • Generated and verified the access token via REST API.
  • Placed test orders using the /order/place endpoint.
  • Integrated order management logic in a virtual environment.

However, I am currently encountering an issue when trying to establish a WebSocket connection to Upstox’s market data feed. The WebSocket connection fails with:

“HTTP 401 Unauthorized”
This error indicates that my application has not yet been authorized for WebSocket usage.
I kindly request that WebSocket access be enabled for my application. I can also provide you with my app credentials if you want me to. I look forward to your support. Thanks.

Please call the Market Data Feed Authorize V3 API to get authorized WSS Connection URL.

Dear Sanjay_Jain,

I have tried that too, when I try to call the /v3/feed/authorize endpoint to get the authorized WebSocket URL for market data feed, I receive the following error:

“status”: “error”,
“errors”: [
{
“errorCode”: “UDAPI100012”,
“message”: “Invalid Endpoint”
I have verified the endpoint, token, headers, and instrumentKeys. If you would have to enable access for this API on my developer app or let me know what I am missing out.

Dear @Sanjay_Jain and Upstox team,

Awaiting for your reply at the earliest.
Thanks.

Dear Upstox Team and @Sanjay_Jain,

Still awaiting your reply for the UNSOLVED issue with the websocket connection. Kindly let me know the following appropriate steps.

Thanks.

@D_11067040 It looks like you’re using an incorrect URL. Please use the correct endpoint: /feed/market-data-feed/authorize. For more information, refer to the documentation link shared above.

Dear @Anand_Sajankar,
Thankyou so much, this helped me solve the issue, also to @Sanjay_Jain .

1 Like