Navigation

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

    AB1010: Invalid Session or Session is Expired Please Re-login

    General Discussion
    13
    50
    244
    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.
    • M
      mihirshah2500 @T167171 last edited by mihirshah2500

      @T167171 Invalid Session or Session is Expired Please Re-login.
      Happening with rmsLimit() api.

      T 1 Reply Last reply Reply Quote 0
      • T
        T167171 @mihirshah2500 last edited by

        @mihirshah2500

        I tried multiple times by generating new sessions each time but still faile

        1. Code to generate session which works fine
        angel_api_key = os.environ.get("ANGEL_API_KEY")
        angel_totp_key = os.environ.get("ANGEL_TOTP_KEY")
        angel_client_id = os.environ.get("ANGEL_CLIENT_ID")
        angel_password = os.environ.get("ANGEL_PASSWORD")
        angel_toptp = pyotp.TOTP(angel_totp_key).now()
        obj = SmartConnect(api_key=angel_api_key)
        #print("totp is ", angel_toptp)
        session = obj.generateSession(angel_client_id, angel_password, angel_toptp)
        refreshToken = session['data']['refreshToken']
        feedToken = obj.getfeedToken()
        userProfile = obj.getProfile(refreshToken)
        
        
        1. Order place API fails
        order_params = {
            "variety": "NORMAL",
            "tradingsymbol": "HAVELLS-EQ",
            "symboltoken": "9819",
            "transactiontype": "BUY",
            "exchange": "NSE",
            "ordertype": "MARKET",
            "producttype": "INTRADAY",
            "duration": "DAY",
            "quantity": 1
        }
        obj.placeOrder(orderparams=order_params)
        
        

        with o/p:
        1 order_params = {
        2 "variety": "NORMAL",
        3 "tradingsymbol": "HAVELLS-EQ",
        (...)
        10 "quantity": 1
        11 }
        ---> 12 obj.placeOrder(orderparams=order_params)

        File ~/.local/lib/python3.10/site-packages/smartapi/smartConnect.py:299, in SmartConnect.placeOrder(self, orderparams)
        296 if params[k] is None:
        297 del (params[k])
        --> 299 orderResponse = self._postRequest("api.order.place", params)[
        300 'data']['orderid']
        302 return orderResponse

        TypeError: 'NoneType' object is not subscriptable

        T 1 Reply Last reply Reply Quote 0
        • T
          T167171 @T167171 last edited by

          @T167171
          Tries rmsLimit API. Getting error in that too
          code:

          obj.rmsLimit()
          

          o/p:

          {'status': False,
           'message': 'Invalid Session or Session is Expired Please Re-login',
           'errorcode': 'AB1010',
           'data': None}
          

          Other API's like obj.position(), obj.orderBook() working fine

          @admin R u going to reply????

          1 Reply Last reply Reply Quote 0
          • R
            rganapthy6 @T167171 last edited by

            @T167171 Same issue happening

            T 1 Reply Last reply Reply Quote 0
            • T
              T167171 @rganapthy6 last edited by

              @rganapthy6
              still hapening?

              T R 2 Replies Last reply Reply Quote 0
              • T
                T167171 @T167171 last edited by

                @T167171
                can you post error screenshot or DM me?
                We can figure out the cause

                T 1 Reply Last reply Reply Quote 0
                • T
                  T167171 @T167171 last edited by

                  @T167171 @rganapthy6

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    rganapthy6 @T167171 last edited by

                    @T167171 Yes

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      rganapthy6 @rganapthy6 last edited by

                      @rganapthy6 38888804-3e0f-4c1e-8be2-cd29cdaea355-image.png

                      1 Reply Last reply Reply Quote 0
                      • R
                        rganapthy6 @T167171 last edited by

                        @T167171 f0949f15-6342-4303-8288-51fc4a9fb504-image.png

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          Chandra shekhar @rganapthy6 last edited by

                          @rganapthy6 Same problem hear

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            rganapthy6 @Chandra shekhar last edited by

                            @Chandra-shekhar @admin When this will be resolved

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              SSumit @rganapthy6 last edited by

                              @admin facing this issue since yesterday.

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

                                Hi @StocksDeveloper @T167171 @rganapthy6 @lakshmi_73 @mihirshah2500 @yash12392 @Sam4173 @Chandra-shekhar @SSumit
                                We regret the inconvenience caused. The issue is now resolved.

                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  T167171 @admin last edited by

                                  @admin The issue is still there. Just now I tried

                                  {'status': False,
                                   'message': 'Invalid Session or Session is Expired Please Re-login',
                                   'errorcode': 'AB1010',
                                   'data': None}
                                  
                                  C 1 Reply Last reply Reply Quote 0
                                  • C
                                    Chandra shekhar @T167171 last edited by Chandra shekhar

                                    @T167171

                                    ---------------11/2/2022 11:27:09 AM------------
                                    ******BUY Order not Executed******
                                    Order Error	:	AB1010
                                    Order Message	:	Invalid Session or Session is Expired Please Re-login
                                    Order Status	:	False
                                    Some error. Please check Token(s)
                                    ------------------------------------------------------
                                    

                                    this problem still there

                                    R T 2 Replies Last reply Reply Quote 0
                                    • R
                                      rganapthy6 @Chandra shekhar last edited by

                                      @Chandra-shekhar Yes still error keeps coming

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        T167171 @Chandra shekhar last edited by

                                        @Chandra-shekhar
                                        @admin is pasting the same reply everywhere without looking into the problem. Such a joke company that claims to be one of the oldest broker and also listed company. I cant believe

                                        R 1 Reply Last reply Reply Quote 0
                                        • R
                                          rganapthy6 @T167171 last edited by

                                          @T167171 Started Working

                                          T 1 Reply Last reply Reply Quote 1
                                          • T
                                            T167171 @rganapthy6 last edited by

                                            @rganapthy6 yes. mine too

                                            R 2 Replies Last reply Reply Quote 2
                                            • First post
                                              Last post