Hi, I am trying the API V2 Quotes api. https://myapi.fyers.in/docs/#tag/Data-Api/paths/~1DataApi/post. I am providing the sumbol as NSE:SBIN-EQ as in the example and passing the app_id:access_token in the header I received from the authentication response. Still I get 209 error saying please add validation parameter. Could you please guide me what more is the request looking for? Thanks.
Hey,
For curl request you can try the below,
curl --location --request GET ‘https://api.fyers.in/data-rest/v2/quotes/?symbols=NSE:SBIN-EQ’ \
–header ‘Authorization: app_id:access_token’
For python you can try the below,
from fyers_api import fyersModel
client_id = “SPXXXXE7-100”
access_token = “eyJ0eXAiOiJK***.eyJpc3MiOiJhcGkuZnllcnM***.IzcuRxg4tnXiULCx3***”
fyers = fyersModel.FyersModel(client_id=client_id, token=access_token, log_path=“/home/user/logs”)
data = {
“symbols”:“NSE:SBIN-EQ,NSE:HDFC-EQ”
}
response = fyers.quotes(data=data)
print(response)
This is what I am doing in Java
HttpGet httpGet = new HttpGet(“https://api.fyers.in/data-rest/v2/quotes/?symbols=” + symbols);
httpGet.addHeader(“Authorization”, CLIENT_ID + “:” + ACCESS_TOKEN);
CloseableHttpResponse response = client.execute(httpGet);
String content = streamToString(response.getEntity().getContent());
JsonObject jsonObject = JsonParser.parseString(content).getAsJsonObject();
return jsonObject;
The response is:
{“s”:“error”,“code”:-209,“message”:“Please provide the validation parameter”}
This is what I am doing in Java
HttpGet httpGet = new HttpGet(“https://api.fyers.in/data-rest/v2/quotes/?symbols=”; + symbols);
httpGet.addHeader(“Authorization”, CLIENT_ID + “:” + ACCESS_TOKEN);
CloseableHttpResponse response = client.execute(httpGet);
String content = streamToString(response.getEntity().getContent());
JsonObject jsonObject = JsonParser.parseString(content).getAsJsonObject();
return jsonObject;
The response is:
{“s”:“error”,“code”:-209,“message”:“Please provide the validation parameter”}