Last update | June 2015 |
Language | C# |
Compilers | Visual Studio 2010 or greater |
Prerequisites | Required elements:
|
The goal of this Getting Started tutorial is to download, build and run the Refinitiv Knowledge Direct (or RKD) for .Net samples to retrieve content from the RKD data services.
This tutorial is part of a series of tutorials enabling the access of RKD content utilizing different technologies. The series includes the following:
The RKD API does not require us to code using any particular technology platform. However, the RKD package references many examples utilizing popular technologies such as Java, Perl, PHP, Ruby, Websphere and .NET. In this tutorial, we will download the RKD .Net samples, review the contents of the package and build and run some of the examples to get us started. Let's walk through the following steps:
Access the RKD .NET sample package from the Downloads section.
Uncompress the .Net package in a directory of your choosing.
The .Net samples contain a number of different examples demonstrating the multiple ways to access content, i.e. HTTP, HTTPS, Web-based access etc. In addition, they include access to content such as news, quotes, chart, fundamental data, etc. For the purposes of this tutorial, our goal is to try a few examples to ensure we can access and demonstrate the variety of RKD content.
In this Quick STart we will reference the following directories within the .Net package:
The package contains a number of test projects, available within a number of sub-directories. Navigate down into the above directories and open the Visual Studio project (.sln). Depending on your Visual Studio version, you may be prompted to update your project file to suit your version.
After compiling this project, move to a command window and launch the executable available under the 'bin' directory, i.e.
> <install dir>\bin\Debug\QuotesHttp.exe
The application will request 3 pieces of data, required for proper authentication, that you have previously acquired. Once authenticated, you will receive a snapshot quote embedded within an XML response:
Response:
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfItemResponse_Short_Or_Full xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ItemResponse_Short_Or_Full>
<Item xmlns="http://www.reuters.com/ns/2006/05/01/webservices/rkd/QuotesCommon">
<RequestKey Name="MSFT.O" Service="IDN" />
<QoS>
<TimelinessInfo Timeliness="DELAYED" TimeInfo="900" />
<RateInfo Rate="TIME_CONFLATED" TimeInfo="3000" />
</QoS>
<Status>
<StatusMsg>OK</StatusMsg>
<StatusCode>0</StatusCode>
</Status>
<Fields>
<F n="DSPLY_NAME">MICROSOFT C</F>
<F n="TRDPRC_1">47.655</F>
<F n="TRDPRC_2">47.6599</F>
<F n="TRDPRC_3">47.657</F>
<F n="TRDPRC_4">47.6501</F>
<F n="TRDPRC_5">47.655</F>
<F n="NETCHNG_1">-0.095</F>
<F n="HIGH_1">47.91</F>
<F n="LOW_1">47.52</F>
<F n="PRCTCK_1">?</F>
<F n="CURRENCY">USD</F>
<F n="TRADE_DATE">11 MAY 2015</F>
<F n="OPEN_PRC">47.55</F>
<F n="HST_CLOSE">47.75</F>
<F n="BID">47.65</F>
<F n="ASK">47.66</F>
<F n="NEWS_TIME">15:01</F>
<F n="BIDSIZE">36</F>
<F n="ASKSIZE">44</F>
<F n="ACVOL_1">10206013</F>
<F n="EARNINGS">2.407</F>
...
<F n="EXCHTIM">15:48:41</F>
<F n="VOL_X_PRC1">47.7084</F>
</Fields>
</Item>
</ItemResponse_Short_Or_Full>
</ArrayOfItemResponse_Short_Or_Full>
This project is launched within the browser of your choosing. Within Visual Studio, execute the run button, in this case, we run within Google Chrome, i.e.
The first page presented delivers the required details to permission yourself. As with example 1 above, these authentication details have previously been acquired. Once authenticated, we are free to select the variety of data options presented within the left browser pane. As a first test, we will retrieve a chart, i.e. Charts - GetChart_1
As a second test, we will retrieve a news story, i.e. News - RetrieveStoryML_1. Within this test, we must select a story ID, as available on the sample page. Once selected, click submit and we are presented with a table of details associated with the news story.
Refinitiv Knowledge Direct API - Developer's Guide