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
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)
@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