static void LastStockPricesForAllInstruments() { ApiClient api = new ApiClient(_apiKey); StockPricesLastRespV1 spList = api.GetStockpricesLast(); foreach (var sp in spList.StockPricesList) { //print InsID : closeprice Console.WriteLine(sp.I + " : " + sp.C); } }
// Return list of last Stockprice for all Instruments public StockPricesLastRespV1 GetStockpricesLast() { string url = string.Format(_urlRoot + "/v1/instruments/stockprices/last"); HttpResponseMessage response = WebbCall(url, _authKey); if (response.IsSuccessStatusCode) { string json = response.Content.ReadAsStringAsync().Result; StockPricesLastRespV1 res = JsonConvert.DeserializeObject <StockPricesLastRespV1>(json); return(res); } else { Console.WriteLine("GetStockpricesLast {0} ({1})", (int)response.StatusCode, response.ReasonPhrase); } return(null); }