Reports
Retrieving online reports is a two-step process:
Step 1: We have to first retrieve the report listings and extract the report ID from each
IOnlineReportsListingResponse listing = OnlineReportsListing.Definition().GetData();
if (listing.IsSuccess)
{
var reportIds = new List<string>();
// The report also has a Name property
foreach (IOnlineReport report in listing.Data.OnlineReports)
{
// The region report token might contain properties like "language" and "description"
// Here we just extract the report ID
foreach (JToken regionReport in report.Reports)
{
reportIds.Add(regionReport["reportId"].ToString());
}
}
}Step 2: Using the report IDs we extracted at step 1, we select one and retrieve its online report story details
// US Science reports
IOnlineReportsResponse reportStory = OnlineReports.Definition("OLUSSCIENCE")
.FullContent(false)
.GetData();
foreach (IOnlineReportStory story in reportStory.Data.OnlineReportStories)
{
Console.WriteLine("----------------------------------------------------------");
Console.WriteLine($"{story.CreationDate}: {story.HeadlineTitle}");
Console.WriteLine($"content Type: {story.ContentType}\n{story.NewsStory}");
}