Error: Looks like you are passing an invalid entry

Hello,

I am trying to execute and retrive data using Fyers API V2 but getting this error again and again.

The documentation is also not yet extensive and hence unable to get the clear idea of session creation and login.

Below is my sample code for reference -

import requests
from fyers_api import fyersModel
from fyers_api import accessToken
import sys
sys.path.insert(0, “/home/pranavshinde/Desktop”)

def login():

session = accessToken.SessionModel(client_id='DBKDUMMY-100',
secret_key='S2W3DUMMY', redirect_uri='[http://awebsite.in/](http://awebsite.in/)',
response_type='code',grant_type='authorization_code')

url = session.generate_authcode()
response = requests.get(url)
print(response.url)

auth_code='eyJ0eXAiOiJKV1QiLCJhbGTYxMjc0NTE3MiwibmJmIjoxNjEyNz5X25hbWUiOiJGUzIxNzYiLCJub25jZSI6IiIsImFwcF9pZCI6IkRCS1VVN1RaTVMiLCJ1dWlkIjoiY2MxMjQ0OTA0ZDAzNDkwNmE3OWMwNTMxMTNkNjBlMDYiLCJpcEFkZHIiOiIxMDMuMjA4LjcxLjMyIiwic2NvcGUiOiIifQ.1D2jqhHI5ooljC8skmlwXr1nU1XCy_DvzUvZVZaPimk'
session.set_token(auth_code)
response = session.generate_token()
print(response)
return response["access_token"]

def retrive(access_token):
fyers = fyersModel.FyersModel(token=access_token, log_path=“/Users/pranavshinde/Desktop”)
print(fyers.positions())

if name == ‘main’:
access_token = login()
retrive(access_token)

Below is the error I am getting for above simple code execution -

fyers.positions()

{‘s’: ‘error’, ‘code’: 500, ‘message’: ‘Looks like you are passing an invalid entry’}

Hi Pranav,

Please raise a ticket regarding the issue. Our support will help you out. Also, you can call us on 080 – 6625 1111

Hope this helps!

Hi, I am also getting same error, can you mention, resolution steps plz,

Thanks.

Hi, I am also getting same error, can you mention, resolution steps plz,

{“s”: “error”, “code”: 500, “message”: “Looks like you are passing an invalid entry”}

Noboday from support team giving the resolution. Now i am waiting since long time.

Finally found a solution:

Please pass your app id (not client id) as first parameter in FyersModel

Example:

fyersModel.FyersModel(client_id=, token=, log_path=“./”)

This will solve your issue