Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. daleep_angel
    D
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    daleep_angel

    @daleep_angel

    0
    Reputation
    6
    Posts
    4
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    daleep_angel Follow

    Best posts made by daleep_angel

    This user hasn't posted anything yet.

    Latest posts made by daleep_angel

    • RE: generateSession issue with new TOPO API : Couldn't parse the JSON response received from the server: b

      Got solution as below.

      Install pyopt library : pip install pyotp

      import pyotp

      use the topo detail with pyotp as below:

      topo = Trading_api_key_details.topo
      topt = pyotp.TOTP(topo)
      topt = topt.now()
      data = obj.generateSession(username,pwd,topt)
      refreshToken= data['data']['refreshToken']
      print(data)

      posted in General Discussion
      D
      daleep_angel
    • RE: generateSession issue with new TOPO API : Couldn't parse the JSON response received from the server: b

      Got solution as below.

      Install pyopt library : pip install pyotp

      import pyotp

      use the topo detail with pyotp as below:

      topo = Trading_api_key_details.topo
      topt = pyotp.TOTP(topo)
      topt = topt.now()
      data = obj.generateSession(username,pwd,topt)
      refreshToken= data['data']['refreshToken']
      print(data)

      posted in Bugs
      D
      daleep_angel
    • RE: Automate totp login using python module - pyotp

      @whemant update the smartapi with command pip install smartapi-python --upgrade

      posted in General Discussion
      D
      daleep_angel
    • generateSession issue with new TOPO API : Couldn't parse the JSON response received from the server: b

      after upgraded the smartapi and providing the TOPO details, getting below error while generating the session. data = obj.generateSession(username,pwd,topo) Please provide the solution JSONDecodeError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in request(self, route, method, parameters) 187 try: --> 188 data = json.loads(r.content.decode("utf8")) 189 C:\ProgramData\Anaconda3\lib\json_init.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None: C:\ProgramData\Anaconda3\lib\json\decoder.py in decode(self, s, _w) 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() C:\ProgramData\Anaconda3\lib\json\decoder.py in raw_decode(self, s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: DataException Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_4956/2840288024.py in <module> ----> 1 data = obj.generateSession(username,pwd,topo) C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in generateSession(self, clientCode, password, totp) 226 227 params={"clientcode":clientCode,"password":password,"totp":totp} --> 228 loginResultObject=self._postRequest("api.login",params) 229 230 if loginResultObject['status']==True: C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in _postRequest(self, route, params) 218 def _postRequest(self, route, params=None): 219 """Alias for sending a POST request.""" --> 220 return self._request(route, "POST", params) 221 def _getRequest(self, route, params=None): 222 """Alias for sending a GET request.""" C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in _request(self, route, method, parameters) 189 190 except ValueError: --> 191 raise ex.DataException("Couldn't parse the JSON response received from the server: {content}".format( 192 content=r.content)) 193 DataException: Couldn't parse the JSON response received from the server: b''

      posted in General Discussion
      D
      daleep_angel
    • generateSession issue with new TOPO API : Couldn't parse the JSON response received from the server: b

      after upgraded the smartapi and providing the TOPO details, getting below error while generating the session.

      data = obj.generateSession(username,pwd,topo)
      Please provide the solution

      JSONDecodeError Traceback (most recent call last)
      C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in _request(self, route, method, parameters)
      187 try:
      --> 188 data = json.loads(r.content.decode("utf8"))
      189

      C:\ProgramData\Anaconda3\lib\json_init_.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
      345 parse_constant is None and object_pairs_hook is None and not kw):
      --> 346 return _default_decoder.decode(s)
      347 if cls is None:

      C:\ProgramData\Anaconda3\lib\json\decoder.py in decode(self, s, _w)
      336 """
      --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      338 end = _w(s, end).end()

      C:\ProgramData\Anaconda3\lib\json\decoder.py in raw_decode(self, s, idx)
      354 except StopIteration as err:
      --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
      356 return obj, end

      JSONDecodeError: Expecting value: line 1 column 1 (char 0)

      During handling of the above exception, another exception occurred:

      DataException Traceback (most recent call last)
      ~\AppData\Local\Temp/ipykernel_4956/2840288024.py in <module>
      ----> 1 data = obj.generateSession(username,pwd,topo)

      C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in generateSession(self, clientCode, password, totp)
      226
      227 params={"clientcode":clientCode,"password":password,"totp":totp}
      --> 228 loginResultObject=self._postRequest("api.login",params)
      229
      230 if loginResultObject['status']==True:

      C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in _postRequest(self, route, params)
      218 def _postRequest(self, route, params=None):
      219 """Alias for sending a POST request."""
      --> 220 return self._request(route, "POST", params)
      221 def _getRequest(self, route, params=None):
      222 """Alias for sending a GET request."""

      C:\ProgramData\Anaconda3\lib\site-packages\smartapi\smartConnect.py in _request(self, route, method, parameters)
      189
      190 except ValueError:
      --> 191 raise ex.DataException("Couldn't parse the JSON response received from the server: {content}".format(
      192 content=r.content))
      193

      DataException: Couldn't parse the JSON response received from the server: b''

      posted in Bugs
      D
      daleep_angel
    • RE: AngelBroking get_access_token failed: AB1050 : Invalid totp

      @raa upgrade the smart api with pip install smartapi-python --upgrade

      posted in General Discussion
      D
      daleep_angel