Navigation

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

    kondorpa

    @kondorpa

    0
    Reputation
    1
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    kondorpa Follow

    Best posts made by kondorpa

    This user hasn't posted anything yet.

    Latest posts made by kondorpa

    • RE: Invalid totp

      @Moderator_2 getting TOTP error again. Here is the code I am running. Anything changed in the code?

      from SmartApi.smartConnect import SmartConnect  #or from SmartApi.smartConnect import SmartConnect
      import pyotp
      from logzero import logger
      
      with open("angelConfig.json", 'r') as f:
          data = json.load(f)
          api_key = data['api_key']
          # username = data['username']
          pwd = data['pwd']
          clientID = data["clientID"]
      smartConn = SmartConnect(api_key)
      
      try:
          token = data['otp_token']
          totp = pyotp.TOTP(token).now()
      
      except Exception as e:
          logger.error("Invalid Token: The provided token is not valid.")
          raise e
      data = smartConn.generateSession("clientID", "pwd", "totp")
      refreshToken = data['data']['refreshToken']
      userProfile = smartConn.getProfile(refreshToken)
      
      payload = {
          "mode": "FULL",
          "exchangeTokens": {
              "NSE": ["3045"]
          }
      }
      MarketQuoteData = smartConn.getMarketData(payload)
      
      posted in General Discussion
      K
      kondorpa