Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Unable to fetch Historical Data for NFO

    Test
    0
    4
    35
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      opt_trader last edited by

      Hi . Unable to fetch Historical data for NFO since yesterday night. Below is the error message:

      I 240613 11:15:36 smartConnect:121] in pool
      [E 240613 11:15:37 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Something Went Wrong, Please Try After Sometime.

      Please look into it

      M 1 Reply Last reply Reply Quote 0
      • M
        Moderator_3 @opt_trader last edited by

        Hello @opt_trader

        Could you please share the header and request body you are passing here

        Regards,
        SmartAPI Team

        O 1 Reply Last reply Reply Quote 0
        • O
          opt_trader @Moderator_3 last edited by

          @Moderator_3 Please find the code :

          obj = SmartConnect(api_key = apikey)
          data = obj.generateSession(clientId, pwd, totp)
          print(data)
          AUTH_TOKEN = data ["data"]["jwtToken"]
          refreshToken = data['data']['refreshToken']
          FEED_TOKEN = feedtoken

          res = obj.getProfile(refreshToken)
          res["data"]["exchanges"]
          print (res)

          And also please find the error message. It is pointing at the jwtToken but I have been using the same since long and the system is also returning the same :


          TypeError Traceback (most recent call last)
          Cell In[4], line 5
          3 data = obj.generateSession(clientId, pwd, totp)
          4 print(data)
          ----> 5 AUTH_TOKEN = data ["data"]["jwtToken"]
          6 refreshToken = data['data']['refreshToken']
          7 FEED_TOKEN = feedtoken

          TypeError: 'NoneType' object is not subscriptable

          M 1 Reply Last reply Reply Quote 0
          • M
            Moderator_3 @opt_trader last edited by

            Hello @opt_trader

            Can you please check and confirm whether you are using the updated sdk or not. Since this was fixed long back.

            Regards,
            SmartAPI Team

            1 Reply Last reply Reply Quote 0
            • First post
              Last post