Navigation

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

    Best posts made by webseos

    • RE: Guide to secure your SmartAPI Account with two factor authentication

      @aj_Brk I have used similar code as given below , but got the following exception
      Exception : Object of type TOTP is not JSON serializable

      but then I solved the problem

      But then I added last two lines and problem solved the last two lines given at the end of the following code- qrOtp is the code generated here : https://smartapi.angelbroking.com/enable-totp below the QR Code. So you have to generate your own qrOtp code here in this site. Then Install pyotp using command line "pip install pyotp"

      My Code Below ( Last line totp = totp.now() is very important)

      from smartapi import SmartConnect #or from smartapi.smartConnect import SmartConnect
      import config
      import pyotp

      client_code = "aaaaaa"
      client_pass = "bbbbbb"

      apiKey="yyyyyyy"
      qrOtp = "xxxxxxxx"
      totp = pyotp.TOTP(qrOtp)
      totp = totp.now()

      smartapiObj =SmartConnect(apiKey)

      data = smartapiObj.generateSession(client_code,client_pass,totp)
      print(data)

      posted in General Discussion
      W
      webseos
    • RE: PHP LTP API

      @admin What is heart beat? I am confused. By the way I developed a code to get LTP: in PHP. If I can get LTP or 1 min GetCandleData why WEBSOCKET wss://....

      ** Pls Add a category in PHP, all going to general discussion

      https://smartapi.angelbroking.com/topic/1203/how-to-get-ltp-sample-source-code-in-php-added-a-getltp-function-error-handling-excluded

      posted in General Discussion
      W
      webseos