Navigation

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

    Invalid Token

    C#/.Net SDK
    0
    1
    20
    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
      shivamrajvansh last edited by

      I am able to use SmartAPI.GenerateSession with TOTP. Using the token response with jwtToken and refreshToken I am able to get success response from smartApi.GetProfile() as well. This is working when executed in one function call.

      But I am getting Invalid Token AG8001 error when calling separately.

      I save jwtToken, refreshToken in DB after successful Login.
      Then i try to call GetProfile method using below code, passing tokens as string:
      var smartApi = new SmartApi(Trading_PrivateKey, Trading_jwtToken, Trading_refreshToken, "");
      var data = smartApi.GetProfile();

      I get Invalid Token error with all endpoints.

      I have also tried to login using all 4 types of APIs offered by SmartAPI but i get token error in all the cases.

      Please let me know in case more information is required.

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