I am using c# to fetch Intraday Candle Data which works fine if I pass stock (NSE_EQ|INE101A01026) or options (NSE_FO|51801) but does not work for index (NSE_INDEX|Nifty 50) It gives “Invalid Instrument key” error.
What do i need to alter in the code or instrument_key in order to get index data from this api.
the request absolute URL that gets form is,
“https://api.upstox.com/v2/historical-candle/intraday/NSE_INDEX%7CNIFTY%2050/1minute”
and the code is,
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, “https://api.upstox.com/v2/historical-candle/intraday/” + requestobj.Symbol.Trim() + “/1minute”);
request.Headers.Add(“Accept”, “application/json”);
request.Headers.Add(“Authorization”, "Bearer " + requestobj.AccessCode);
var response = client.SendAsync(request);
var jsonResponse = response.Result.Content.ReadAsStringAsync();
Please help