Invalid Token


  • 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.


  • Hello @shivamrajvansh

    1- Coluld you please tell me the sdk, that you are using for the same ?

    Regards,
    SmartAPI Team