Navigation

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

    The token is invalid

    C#/.Net SDK
    0
    6
    88
    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.
    • V
      Vishal.naykawala last edited by

      below code not working from today [3-1-2023], It was working fine. any change in that?

      SmartApi connect = new SmartApi(api_key, JWTToken, RefreshToken);
      //SmartApi connect = new SmartApi(api_key);
      OutputBaseClass obj = new OutputBaseClass();
      GetTotp();
      //Login by client code and password
      obj = connect.GenerateSession(Client_code, Password, Totp);
      obj = connect.GenerateToken();

                      AngelToken agr = obj.TokenResponse;
                      agr = obj.TokenResponse;
      
                      if (agr == null)
                      {
                          Console.WriteLine("Please check, Connection fail!");
                          //Console.ReadLine();
                          Thread.Sleep(1000);
                          continue;
                      }
      
      N 1 Reply Last reply Reply Quote 0
      • S
        shivdasb1996 last edited by

        @Vishal-naykawala ,

        replace your password with MPIN.
        and try it will work

        A 1 Reply Last reply Reply Quote 0
        • B
          Bharath Ron last edited by

          Please pass the MPIN in place of password

          1 Reply Last reply Reply Quote 1
          • T
            ThetaDecay last edited by

            I also got error today

            03-Jan-23 12:04:14 - Attempt#0 to initialize Angel SDK
            03-Jan-23 12:04:14 - Exception occured while Initializing Angel SDK
            Traceback (most recent call last):
              File "/home/a/Desktop/angel_st/src/angel_main.py", line 69, in init_angel_SDK
                refreshToken = data['data']['refreshToken']
            TypeError: 'NoneType' object is not subscriptable
            03-Jan-23 12:04:14 - Exception: 'NoneType' object is not subscriptable
            Traceback (most recent call last):
              File "/home/a/Desktop/angel_st/src/angel_main.py", line 69, in init_angel_SDK
                refreshToken = data['data']['refreshToken']
            TypeError: 'NoneType' object is not subscriptable
            
            1 Reply Last reply Reply Quote 0
            • N
              Nichil72 @Vishal.naykawala last edited by

              @Vishal-naykawala Kindly put MPIN instead of Password.

              1 Reply Last reply Reply Quote 0
              • A
                amrutjk @shivdasb1996 last edited by

                @shivdasb1996
                Can someone share the updated method to use TOtp?
                GetTotp();
                //Login by client code and password
                obj = connect.GenerateSession(Client_code, Password, Totp);

                GenerateSession method accepts only 2 parameters. How to pass totp ?

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