Hi @ABHINAV_7755754
This step requires execution within a web browser. Using the API for this purpose will redirect you to the Upstox login page in a browser, where you must input your login credentials. For more comprehensive information, please refer to the following documentation: Authentication | Upstox Developer API.
question here is shouldnât the redirect uri be the one that I mentioned instead of the api-v2.upstox?
it should be localhost:5000/upstox_redirect right?
found the issue. if we do a requests.get on the url then it gives a default redirect uri. instead if we create a url with those params using urlencode then we get the correct result. Now i m able to get the access token.
New problem with websockets.
PS F:\programming\tb2025\v3> python .\websocket_client.py
{'status': 'success', 'data': {'authorizedRedirectUri': 'wss://wsfeeder-api.upstox.com/market-data-feeder/v3/upstox-developer-api/feeds?requestId=b35e8a06-92fa-4ee0-843a-a4ad06c80754&code=x2Ba0-912af0bf-75db-41cb-a6b7-f3eae627f510', 'authorized_redirect_uri': 'wss://wsfeeder-api.upstox.com/market-data-feeder/v3/upstox-developer-api/feeds?requestId=b35e8a06-92fa-4ee0-843a-a4ad06c80754&code=x2Ba0-912af0bf-75db-41cb-a6b7-f3eae627f510'}}
Connection established
Traceback (most recent call last):
File "F:\programming\tb2025\v3\websocket_client.py", line 75, in <module>
asyncio.run(fetch_market_data())
File "C:\Users\macab\.pyenv\pyenv-win\versions\3.12.7\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\macab\.pyenv\pyenv-win\versions\3.12.7\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\macab\.pyenv\pyenv-win\versions\3.12.7\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "F:\programming\tb2025\v3\websocket_client.py", line 65, in fetch_market_data
decoded_data = decode_protobuf(message)
^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\programming\tb2025\v3\websocket_client.py", line 26, in decode_protobuf
feed_response = pb.FeedResponse()
^^^^^^^^^^^^^^^
AttributeError: module 'MarketDataFeedV3_pb2' has no attribute 'FeedResponse'