Navigation

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

    Unable to login

    General Discussion
    3
    6
    39
    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.
    • S
      Sailash last edited by

      @admin I am trying to connect to the api through python. Currently I am getting NameError with folloiwng message. Is there a bug?

      ~\Anaconda3\envs\angel1\lib\site-packages\smartapi\smartConnect.py in generateSession(self, clientCode, password)
      242 loginResultObject=self._postRequest("api.login",params)
      243
      --> 244 if loginResultObject['status']==True or true:
      245 jwtToken=loginResultObject['data']['jwtToken']
      246 self.setAccessToken(jwtToken)

      NameError: name 'true' is not defined

      A S 2 Replies Last reply Reply Quote 0
      • A
        admin @Sailash last edited by admin

        @Sailash said in Unable to login:

        Is there a bug

        Hi, there are no bugs in Python SDK.

        Please refer : https://github.com/angelbroking-github/smartapi-python

        S 1 Reply Last reply Reply Quote 0
        • S
          Sailash @admin last edited by

          @admin I have tried the steps mentioned in the github...with the same code. Still the same. Can you please let me know where is the fault?

          from smartapi.smartConnect import SmartConnect #or
          #import smartapi.smartExceptions(for smartExceptions)

          #create object of call

          smartApi =SmartConnect(api_key="xxxx")
          obj=SmartConnect(api_key="xxxx")
          #login api call

          data = smartApi.generateSession("Mxxx","Gxxxxx")
          refreshToken = login['data']['refreshToken']

          S 1 Reply Last reply Reply Quote 0
          • S
            sajy @Sailash last edited by

            @Sailash
            just type this in your browser https://smartapi.angelbroking.com/publisher-login?api_key=xxx
            you get log in page.
            use api keys generated by you at xxx.
            will see log in page

            1 Reply Last reply Reply Quote 0
            • S
              sajy @Sailash last edited by sajy

              @Sailash
              remove 'or true' from file smart connect py line 244

              A 1 Reply Last reply Reply Quote 0
              • A
                admin @sajy last edited by

                Hi @Sailash @sajy , we have updated our python SDK. Please reinstall and try again.

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