Beispiel #1
0
        //Get Reports for one company (ABB)
        static void Reports()
        {
            ApiClient api = new ApiClient(_apiKey);

            // One call to get all report for one Instrument
            ReportsRespV1 rAll = api.GetReports(3);

            Console.WriteLine("Year count: " + rAll.ReportsYear.Count());
            Console.WriteLine("R12 count: " + rAll.ReportsR12.Count());
            Console.WriteLine("Quarter count: " + rAll.ReportsQuarter.Count());


            // You can also get list of reports for each Year, R12, Quarter
            ReportsYearRespV1 rY = api.GetReportsYear(3);

            Console.WriteLine("Year count: " + rY.Reports.Count());

            ReportsR12RespV1 r12 = api.GetReportsR12(3);

            Console.WriteLine("r12 count: " + r12.Reports.Count());

            ReportsQuarterRespV1 rQ = api.GetReportsQuarter(3);

            Console.WriteLine("Quarter count: " + rQ.Reports.Count());
        }
Beispiel #2
0
        /// <summary> Return Quarter reports (Normaly data for last 3 month) for one instrument (max 10 reports)</summary>
        public ReportsQuarterRespV1 GetReportsQuarter(long instrumentId)
        {
            string url = string.Format(_urlRoot + "/v1/instruments/{0}/reports/quarter", instrumentId);
            HttpResponseMessage response = WebbCall(url, _authKey);

            if (response.IsSuccessStatusCode)
            {
                string json = response.Content.ReadAsStringAsync().Result;
                ReportsQuarterRespV1 res = JsonConvert.DeserializeObject <ReportsQuarterRespV1>(json);
                return(res);
            }
            else
            {
                Console.WriteLine("GetReportsQuarter {0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }

            return(null);
        }