tWPDXE1xbt
(Inactive Member)
May 5, 2022, 2:02pm
1
***This is the code in python***
from fyers_api import fyersModel
import os
import requests
from fyers_api import accessToken
import credential
session = accessToken.SessionModel(client_id=[credential.app](http://credential.app)_id,secret_key=credential.secret,redirect_uri=credential.redirect_url, response_type="code",grant_type="authorization_code")
print(session.generate_authcode())
auth_code = input("Provide Your auth code :")
session.set_token(auth_code)
response = session.generate_token()
response = session.generate_token()
print(response)
***whenever I am trying to login gives the following error***
**{'s': 'error', 'code': -413, 'message': 'Your auth code has expired. Please generate a new auth code'}**
vivek4
(Vivek)
December 17, 2022, 3:55pm
2
facing the same issue. The token is getting expired after single use.
The issue is real and persistent. I generate a new auth code and new token and when I try to get the Profile, I get a message saying “message: ‘Your auth code has expired. Please generate a new auth code’”. This happens in the NodeJS sample code shared by ur org in NPM website. Please advice.
WWhYB2qrsx
(Inactive Member)
September 23, 2024, 7:12am
4
Hey @100140584156345983500
Can you please try to login and hit the API with the sample code given in the below URL :
https://myapi.fyers.in/docsv3#tag/Authentication-and-Login-Flow-User-Apps/paths/~1Authentication%20&%20Login%20Flow%20-%20User%20Apps/post
If this doesn’t work please mask your credentials and send us the script used , that would be helpful to check this .