py5paisa icon indicating copy to clipboard operation
py5paisa copied to clipboard

access_token=None when fetching market depth

Open bhaskar-c opened this issue 3 years ago • 4 comments

  • 5paisa Python SDK version: py5paisa-0.5.3.dist-info
  • Python version: 3.8.10
  • Operating System: Ubuntu

Description

I get the "Logged in!!" message. Then I am trying to fetch market depth with the provided example which fails with the following nondescript message:

'access_token'

Check the following line(825) on py5paisa.py

    def market_depth_token(self):
        try:
            response = self.session.post(self.MARKET_DEPTH_ROUTE, headers=self.jwt_headers).json()

This returns the following error response which is not very helpful.

{'body': {'CacheTime': 1, 'Data': None, 'Message': 'Error while processing your request.', 'Status': -1, 'TimeStamp': '/Date(1658726873071+0530)/'}, 'head': {'responseCode': '5PMD', 'status': '0', 'statusDescription': 'Success'}} As a result the access_token is None and market_depth_url is malformed as follows:

wss://openapi.5paisa.com/ws?subscription-key=c89fab8g895a426d9e00db380b567027&access_token=None

bhaskar-c avatar Jul 25 '22 09:07 bhaskar-c

I am also getting the error with the market depth api

Get19:06:23 | Logged in!! <py5paisa.py5paisa.FivePaisaClient object at 0x7fc7cc7bc160> 19:06:23 | 'access_token' None

phantomdrake077 avatar Jul 26 '22 13:07 phantomdrake077

we are looking into it, we will resolve it soon.

5paisa avatar Aug 08 '22 13:08 5paisa

we are looking into it, we will resolve it soon.

Can you give me a tentative date ? This query remained unanswered and so I have already waited for 2 weeks. Just let me know a tentative time frame, so I can plan accordingly.

bhaskar-c avatar Aug 08 '22 15:08 bhaskar-c

The issue is fixed, please update the library and let us know if any issues.

5paisa avatar Aug 12 '22 10:08 5paisa