API apps status

Hello,

I have created a new FYERS API app yesterday and teh status remains “Requested”. Please can you let me know if i have to do anything else for this to be changed to Active ?

Also i tried creating auth token in requested state and i got invalid app id response. Hope this will be resolved when the app status changes to active.

Please let me know.

is this resolved? I also have this issue.

I just saw this thread but you only have to activate it. You need to write a python code to get it done. Fyers has nothing to do with it.

@vishnu_bharath what is python code to activate app?? do you have python code, please help..

client_id = "XXXXXX"

secret_key = "XXXXXX"

redirect_uri="[http://localhost:5000](http://localhost:5000)"

response_type="code"

grant_type="authorization_code"

app_session = accessToken.SessionModel(client_id=client_id,secret_key=secret_key,redirect_uri=redirect_uri,response_type=response_type, grant_type=grant_type)

response = app_session.generate_authcode()

driver = [webdriver.Chrome](http://webdriver.Chrome)("YYYYYY")

driver.get(response)

time.sleep(5)

driver.find_element_by_xpath('//*[@id="fyers_id"]').send_keys("XXXXXX")

driver.find_element_by_xpath('//*[@id="password"]').send_keys("XXXXXX")

driver.find_element_by_xpath('//*[@id="pancard"]').send_keys("XXXXXX")

driver.find_element_by_xpath('//*[@id="btn_id"]').click()

time.sleep(10)

start = driver.current_url.find('auth_code=')+10

end = driver.current_url.find('&state=None', start)

auth_code=driver.current_url[start:end]

app_session.set_token(auth_code)

response = app_session.generate_token()

access_token = response["access_token"]

is_async = False #(By default the async will be False, Change to True for async API calls.)

fyers = fyersModel.FyersModel(client_id=client_id, token=access_token, log_path="/Users/vishnubharath/Desktop/Fyerslogs")

driver.quit()

Dependencies are:

import fyers_api

import selenium

from selenium import webdriver

from fyers_api import accessToken

from fyers_api import fyersModel

ALL the XXXXXX are to be input by you. The YYYYYY is also to be input by you and that is the location on chromedriver on your system.

the api status would be updated by the fyers team.Mine got updated to approve in one day

However you need to write your own code to connect to this api

I’ve been using the api for trading extensively and you need to activate it through the code. Maybe they will approve on request which I’m not aware of.

yes the fyers team updates the status of the fyers app to Approved

i was facing issues earlier before the app got approved

https://community.fyers.in/question/how-long-does-it-take-for-an-api-app-to-get-approved-when-i-rin-the-puthon—60f16f4403b5cb14a696bc99?intent=comment#comment-610cc07d5b64b928f287c946

driver = webdriver.Chrome(“YYYYYY”)

HOW TO GET THIS “YYYYYY”

driver = webdriver.Chrome(chromedriver_path, options=options)

you can replace the path of the chromedriver instead of the variable chromedriver_path

and add or remove the variable options depending if you are using any

options = webdriver.ChromeOptions()
options.add_argument(“–window-size=1920,1080”)
options.add_argument(“–headless”)
options.add_argument(“–disable-gpu”)
options.add_argument(
“user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36”)
options.add_experimental_option(“prefs”, {
“download.prompt_for_download”: False,
download.directory_upgrade”: True,
“safebrowsing.enabled”: True
})

here i have stored all of my paths and passwords in a .env file

chromedriver_path = get_path(‘CHROMEDRIVER_PATH’)

driver = webdriver.Chrome(chromedriver_path, options=options)

@ayan_pal is probably right. However, the YYYY is just the path of the chromedriver. If you have saved your chromedriver in your downloads. Just see the path to it. If you don’t know how to find the path, just google it. It is quite straightforward.

THANKS..:slight_smile:

i am getting this error

app_session = accessToken.SessionModel(client_id=client_id,secret_key=secret_key,redirect_uri=redirect_uri,response_type=response_type, grant_type=grant_type)

TypeError: init() got an unexpected keyword argument ‘client_id’

You have to uninstall and reinstall the fyers package.

Thank you very much, its done…:slight_smile: