Invalid Token error is coming during the trading session.


  • Invalid Token error is coming during the trading session.

    I am generating the access token around 9.00 AM and using this token during the day. But token is getting invalidated after sometime during the trading session.

    [E 240607 10:25:10 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder. Error: Invalid Token. URL: https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.147.98', 'X-MACAddress': '3b:6f:e8:a0:38:7f', 'Accept': 'application/json', 'X-PrivateKey': '3cob7ymd', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'variety': 'NORMAL', 'tradingsymbol': 'BANKNIFTY12JUN2449400PE', 'symboltoken': '36794', 'transactiontype': 'BUY', 'exchange': 'NFO', 'ordertype': 'MARKET', 'producttype': 'CARRYFORWARD', 'duration': 'DAY', 'price': '0', 'triggerprice': '0', 'trailingStopLoss': '0', 'squareoff': '0', 'stoploss': '0', 'quantity': 15}, Response: {'success': False, 'message': 'Invalid Token', 'errorCode': 'AG8001', 'data': ''}

    If you see, error came around 10:25:10 AM, but order got placed successfully with the same token around 10:24:20 AM. Due to this my algo is not working properly.