Unable to login using SmartAPI Javascript Library - Getting Invalid Token - AG8001
-
Code
let { SmartAPI, WebSocket } = require("smartapi-javascript"); let smart_api = new SmartAPI({ api_key: appConfig.angel.marketApiKey, // PROVIDE YOUR API KEY HERE" }); smart_api.generateSession(appConfig.angel.clientId, appConfig.angel.clientPwd) .then((data: any) => { return smart_api.getProfile(); }) .then((data: any) => { // Profile details console.log(data); }) .catch((ex: any) => { //Log error console.log(ex); }) // TO HANDLE SESSION EXPIRY, USERS CAN PROVIDE A CUSTOM FUNCTION AS PARAMETER TO setSessionExpiryHook METHOD smart_api.setSessionExpiryHook(customSessionHook); function customSessionHook() { console.log("User loggedout"); // NEW AUTHENTICATION CAN TAKE PLACE HERE }
Error
User loggedout { success: false, message: 'Invalid Token', errorCode: 'AG8001', data: '' }
Client ID: N174188
-
@admin Thanks it's working now after migration thanks
-
Hi @jigs1996 Have you migrated your account?
-
@admin
i have the same issue -
@nisha said in Unable to login using SmartAPI Javascript Library - Getting Invalid Token - AG8001:
N174188
we have noticed your issue.Provide us your contact details to further assist you.