DataScope Select - REST API

Close Menu
Expand All Collapse All
Introductory Tutorials Tutorials Introduction Programming without SDK Tutorial REST API Tutorials REST API Tutorials Introduction REST API Tutorial 1: Connecting to the DSS server REST API Tutorial 2: On Demand End of Day Extraction REST API Tutorial 3: On Demand intraday extraction, embargo REST API Tutorial 4: On Demand price history extraction REST API Tutorial 5: On Demand corporate actions extraction REST API Tutorial 6: On Demand ownership data extraction REST API Tutorial 7: On Demand T&C extraction REST API Tutorial 8: On Demand composite extraction REST API Tutorial 9: On Demand extraction: instrument list REST API Tutorial 10: GUI control calls: immediate extract REST API Tutorial 11: Search by Instrument REST API Tutorial 12: Search for an Equity REST API Tutorial 13: Search for a Future or Option REST API Tutorial 14: On Demand price history extraction raw .Net SDK Tutorials .Net SDK Tutorial 1: Connecting to the DSS server .Net SDK Tutorial 2: GUI control calls: List, report, sched .Net SDK Tutorial 3: GUI control calls: Validate, extraction .Net SDK Tutorial 4: GUI control calls: Embargo, note files .Net SDK Tutorial 5: On Demand: EoD extraction .Net SDK Tutorial 6: On Demand: EoD extraction, file I/O .Net SDK Tutorial 7: On Demand: large instrument lists .Net SDK Tutorial 8: On Demand: Terms & Conditions .Net SDK Tutorial 9: On Demand: Composite extraction .Net SDK Tutorial 10: Search by Instrument .Net SDK Tutorial 11: Search for Equity .Net SDK Tutorial 12: Search for Future or Option

REST API Tutorial 1: Connecting to the DSS server

Last update November 2019
Environment Any
Language Any HTTP is supported
Compilers None
Prerequisites DSS login, internet access
Source code Below

Tutorial purpose

This tutorial explains how to request an authentication token from the DSS server.

This is the starting point and a pre-requisite for all the other tutorials.

It also illustrates how to get user information using the token, which is a way to test if it is still valid.

A Postman collection and environment are available in the downloads, but you can also enter HTTP requests manually.

 

Table of contents

 

User authentication

The DSS REST API requires a valid DSS username and password in order to access any of the API capabilities. These username and password are the same as those used for your DSS web GUI, FTP or DSS SOAP API credentials.

The DSS username and password are used to request an authentication token. The received token must be cached, and attached to all following requests to the DSS server.

The tokens are valid for 24 hours, after which a 401 (Unauthorized, Authentication Required) status code is returned. At that point a new token must be requested.

 

Authentication - HTTP request

Note: you must provide valid DSS credentials (username and password) in the body of the request.

URL:               

https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken

Method:          POST

Headers:

Prefer: respond-async
Content-Type: application/json

Body:

{
  "Credentials": {
    "Username": "33314",
    "Password": "XXXXXXX"
  }
}

 

Authentication - HTTP response

Status:                        200 OK

Relevant headers:

Content-Type: application/json; charset=utf-8

The content is in JSON (JavaScript Object Notation) format. 

Body:

{
  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Edm.String",
  "value": "A6C451842A8FF72ECFB75DFF63AD8D03FE3D486FD1EB8EE48B296A8D469BE732DAA16356CF75BC0E349456694DAB3C650AB199C66C46016D33D5AAB1B4E44D22AD14905DAF573D21BFA771CCA58DAA63C1EF71BB488D768988A65E6A47B0F797F9DFCE8DCBBD516BAD8C33C6C629CD5B3B276D4D4A8C89ABD0A318F2B3893ED0C160B2E831A673D1AA8BA3EDE1945BA0083DADBF548EA8644CD01831AE3F5F27CF7AE06D2614792178723E005CE5DDABB4C9E6DD247B17A1775C418A009005DFF417EB2729CC61FF4021C147D9ED976A6FF02F8931F2B75ED8BCED3B1D182450"
}

The returned value is the token.

 

Get user information - HTTP request

Notes:

  • For all requests we need to include a user token in the header of our request. That is the token we just retrieved.
  • The DSS user name is set as a parameter in the path.

Let us make a request for user information. Making a simple request allows us to test the validity of a token.

URL:               

https://hosted.datascopeapi.reuters.com/RestApi/v1/Users/Users(33314)

Method:          GET

Headers:

Prefer: respond-async
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061

 

Get user information - HTTP response

If the token is valid, this is the response we get:

Status:                        200 OK

Relevant headers:

Content-Type: application/json; charset=utf-8

Body:

{
  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Users/$entity",
  "UserId": 33314,
  "UserName": "Firstname Lastname",
  "Email": "firstname.lastname@domain.com",
  "Phone": "xxx-xxx-xxxx"
}

If the token is not valid, or has expired, a 401 (Unauthorized, Authentication Required) status code is returned.

Tutorial Group: 
REST API Tutorials