Need help in Unblocking/Whitelisting my IP address, i am getting 403 Forbidden Error with Web Sock

Hi Team , I would like to whitelist my ipaddress which is being blocked by cloud flare

Here is the IP address : 65.20.75.231

User ID : AV6001

when i try to authenticate i get forbidden error from websocket

Please find the ticket ID for Reference , my Websocket permissions doesnt seem to work 9752412

Here is the error information

Error: Handshake status 403 Forbidden -±± {‘date’: ‘Tue, 24 Feb 2026 09:39:34 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’} -±± None

Request

import upstox_client

import time

def on_message(message):

print(f"Message received: {message}")

def on_open():

print("WebSocket opened")

def on_error(error):

print(f"Error: {error}")

def on_close():

print("WebSocket closed")

def main():

configuration = upstox_client.Configuration()

access_token = "eyJ0eXAiOiJKV1QiLCJrZXlfaWQiOiJza192MS4wIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJBVjYwMDEiLCJqdGkiOiI2OTlkNWNmNGYxODdhOTZmZWIwNjVhZjkiLCJpc011bHRpQ2xpZW50IjpmYWxzZSwiaXNQbHVzUGxhbiI6ZmFsc2UsImlhdCI6MTc3MTkyMDYyOCwiaXNzIjoidWRhcGktZ2F0ZXdheS1zZXJ2aWNlIiwiZXhwIjoxNzcxOTcwNDAwfQ.MGSQ9UNlCIq0759u0qbAniHPMMFYtfg4IoeRWA_SzZQ"

configuration.access_token = access_token

streamer = upstox_client.MarketDataStreamerV3(

    upstox_client.ApiClient(configuration), \["NSE_FO|59182"\], "full")

streamer.on("message", on_message)

streamer.on("open", on_open)

streamer.on("error", on_error)

streamer.on("close", on_close)

streamer.connect()



time.sleep(10)

if _name_ == “_main_”:

main()

Also i have tried this format for request , still i get 403 json

{

"guid": "unique-uuid-v4",

"method": "sub",

"data": {

    "mode": "full",

    "instrumentKeys": \["NSE_EQ|INE123A01012", "..."\]

}

}

Key details:

- **guid**: A unique UUID v4 identifier for each request

- **method**: “sub” for subscription

- **data.mode**: The subscription mode (e.g., “full”, “ltpc”, “quote”)

- **data.instrumentKeys**: Array of instrument keys to subscribe to

The request is sent as binary data (UTF-8 encoded JSON) using the WebSocket BINARY opcode:

python

self.ws.send(json.dumps(request).encode(‘utf-8’), opcode=websocket.ABNF.OPCODE_BINARY)

Hi @Ushnota and @Ketan : Can you help out here please

@MOHAMED_BA_2034950 Working fine. 403 Forbidden could be because of incorrect access_token. Try access_token generated from Upstox Accounts .

Hi @DSingh : Thanks its working now

1 Like