HI
I am getting Unauthorized 401 error while making Websocket connection to Upstox backend. However the call to get Historic Data is working fine. I am only facing issue with Websocket connection.
Please check.
upstox_client.rest.ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Thu, 30 May 2024 07:09:49 GMT’, ‘Content-Type’: ‘application/json’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘keep-alive’, ‘X-Content-Type-Options’: ‘nosniff’, ‘X-XSS-Protection’: ‘1; mode=block’, ‘Pragma’: ‘no-cache’, ‘Strict-Transport-Security’: ‘max-age=0; includeSubDomains’, ‘X-Frame-Options’: ‘DENY’, ‘Cache-Control’: ‘must-revalidate,no-cache,no-store’, ‘Vary’: ‘Origin, Access-Control-Request-Method, Access-Control-Request-Headers’, ‘message’: ‘request failed’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘Set-Cookie’: ‘__cf_bm=T1rXTv67.AY8oNeu6s_ZU4wFS.wmO05dL84Ff_AoIkQ-1717052989-1.0.1.1-UgT65MOss9I_7F7VrDNcErHkHbxcj_QG8NlIeVQXYo9Rz1pfBE7aYM1aaof3Ay_c; path=/; expires=Thu, 30-May-24 07:39:49 GMT; domain=.upstox.com; HttpOnly; Secure; SameSite=None, _cfuvid=y8e3tpRoAWtJC8xSnFFNdnqfi60PYpFfBhYpwKeeU4s-1717052989075-0.0.1.1-604800000; path=/; domain=.upstox.com; HttpOnly; Secure; SameSite=None’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘88bce69d89523fe4-BOM’})
HTTP response body: b’{“status”:“error”,“errors”:[{“errorCode”:“UDAPI100050”,“message”:“Invalid token used to access API”,“propertyPath”:null,“invalidValue”:null,“error_code”:“UDAPI100050”,“property_path”:null,“invalid_value”:null}]}’