Hi Lohitha,
I would suggest to use this site - https://emn178.github.io/online-tools/sha256.html172
enter the app_id:access_token in the input and check if it matches with the one you are generating.
Edit: Do check the given python script, comment/uncomment the function calls as needed,
from fyers_api import fyersModel
from fyers_api import accessToken
import webbrowser
def generate_auth_code(client_id, secret_key, redirect_uri, response_type):
session = accessToken.SessionModel(client_id=client_id, secret_key=secret_key, redirect_uri=redirect_uri, response_type=response_type)
auth_code_url = session.generate_authcode()
webbrowser.open31(auth_code_url,new=1)
def generate_access_token(auth_code, client_id, secret_key, redirect_uri, response_type, grant_type):
session = accessToken.SessionModel(client_id=client_id, secret_key=secret_key, redirect_uri=redirect_uri, response_type=response_type, grant_type=grant_type)
session.set_token(auth_code)
response = session.generate_token()
access_token = response["access_token"]
print(access_token)
def data_api_call(client_id, access_token):
fyers = fyersModel.FyersModel(token=access_token,is_async=False, log_path="/home/user/fyers/fyers-api/logs",client_id=client_id) # Enter you desired log path store the logs on your system
print(fyers.get_profile())
print()
history_data = {"symbol":"NSE:SBIN-EQ","resolution":"D","date_format":"0","range_from":"1622097600","range_to":"1622097685","cont_flag":"1"}
print(fyers.history(history_data))
print()
quotes_data = {"symbols": "NSE:SBIN-EQ"}
print(fyers.quotes(quotes_data))
def main():
# enter your client ID (i.e., the app ID)
client_id = ""
# Enter the secret key of your app
secret_key = ""
redirect_uri = "https://trade.fyers.in/api-login/redirect-uri/index.html44"
response_type = "code"
generate_auth_code(client_id, secret_key, redirect_uri, response_type)
auth_code = ""
grant_type = "authorization_code"
generate_access_token(auth_code, client_id, secret_key, redirect_uri, response_type, grant_type)
access_token = ""
data_api_call(client_id, access_token)
if __name__ == '__main__':
main()