Last update |
Dec 2023 |
Environment | Windows |
Language | Any HTTP is supported |
Compilers | None |
Prerequisites | DSS login, internet access. Having done the Quick Start. |
Source code | None |
This is an introduction to the REST API (pure HTTP) tutorials, for interacting with the LSEG Tick History REST API webservices in HTML, and programming without the .Net SDK.
Two topics are covered:
For a more generic overview of the entire set of LSEG Tick History REST API tutorials, including programming approaches and more, see the Tutorials Introduction.
To ensure both seasoned and beginner developers can benefit from this tutorial set, some very basic instructions topics are covered here. The following tutorials assume such knowledge has been acquired, and concentrate on the LSEG Tick History API.
A DSS user account (user name and password) is required, because the API uses it to authenticate to the server. These username and password will be provided to LSEG Tick History customers and are valid both in the API and the GUI.
An internet connection is required to download ARC and run the examples, as they must connect to the server.
If you have not yet gone through the Quick Start, do it now before proceeding further, as that is where you discover the REST API C# example application, a powerful learning tool also useful when programming in pure HTTP, without using the .Net SDK. The Quick Start also describes its installation, and how to run it, even without a compiler.
Our tutorials use one particular REST client, Postman. This is by no means an endorsement of Postman, it is just an example to get you started. Feel free to use any other REST client you might prefer.
Postman used to be a Chrome plug-in, that version is now obsolete. We recommend you install and use the latest standalone version. Download and install Postman following the instructions on the web site.
A Postman collection and environment are available in the downloads, but you can also enter HTTP requests manually.
If you are using a different REST client, the process will follow a similar logic.
Each request is described using several fields:
Example for the Authentication Request at the start of the REST API Tutorial 1: Connecting to the server:
Tutorial contents:
URL:
https://selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/RequestToken
Method: POST
Headers:
Prefer: respond-async
Content-Type: application/json
Body:
{
"Credentials": {
"Username": "33314",
"Password": "XXXXXXX"
}
}
Entering the details in Postman:
After selecting the method, copying the URL, and copying the request headers using Bulk Edit mode:
After filling in the Body using raw mode:
Important note: before running this particular request, replace the Username and Password values with those of your own DSS account !
After pressing the send button, and if the DSS account is valid, the response is displayed. Headers and status:
Body, pretty-parsed in Jason format:
It corresponds to the contents of the tutorial.
Note how the JSON formatted output has been automatically recognised, parsed and coloured for easy reading.
Even if you are not programming in C#, the C# example application is very useful !
This is because it shows all the HTTP requests and responses related to particular actions, so all use cases in the C# example application become easy to understand and re-use, whatever language you might be programming in.
Let us look again at the example for the Authentication Request at the start of the REST API Tutorial 1: Connecting to the server:
Tutorial contents:
URL:
https://selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/RequestToken
Method: POST
Headers:
Prefer: respond-async
Content-Type: application/json
Body:
{
"Credentials": {
"Username": "33314",
"Password": "XXXXXXX"
}
}
The same HTTP messages in the C# example application:
If you have not yet gone through the Quick Start, do it now before proceeding further, to install and run that application.
Run the application; enter a valid DSS username and password. Then:
4. Once the example has run, the requests are listed in the top right window. Select a request by clicking on it.
5. Click on the HTTP header to display all the details of the HTTP request and response in the lower right window:
The HTTP request method, host, path, header and body are displayed (the real username and password are hidden).
The HTTP response details (status and body) are also displayed, so you can see what to expect:
This easy method to display the details of the HTTP requests and responses can be applied to all use cases illustrated in the C# example application. This is why this application is so useful, even to programmers not using C#.
Caveats:
Now proceed to the other REST API tutorials. Once you have studied and understood them, it will be easy for you to investigate other use cases not covered and explained in detail in the tutorials, but available in the C# example application.