I am using python to access my app , I have added code snippets below. Please help in finding the error here.
Step I:
I am generating a login url and logging in my account where I get my auth_code in the redirect_url.
Step 2:
I am storing that access_token in an local file, to use during the day in all the API calls.
Step 3:
When I call any API, I get this error
{
"message": "Please provide valid token",
"code": -15,
"s": "error"
}
I have verified that the access_token used for the API call is the updated one.
Code Snippets:
Login:
appSession = fyersModel.SessionModel(
client_id=cr.app_id,
redirect_uri=cr.redirect_url,
response_type=cr.response_type,
state=cr.state,
secret_key=cr.secret_id,
grant_type=cr.grant_type,
)
generateTokenUrl = appSession.generate_authcode()
Getting Data:
response = fyers.optionchain(
data={
"symbol": symbol,
"strikecount": 1,
"timestamp": "",
}
)