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 7: On Demand T&C extraction

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:

  • Retrieve the available field list from the DSS server.
  • Retrieve T&C (terms and conditions) data from the DSS server, using an on demand request. T&C fields are a subset of those available in a composite extraction. In this example we retrieve a few terms and conditions fields. The use case is to cross reference instrument codes, i.e. retrieve several instrument codes (RIC; Cusip, ISIN, Sedol, etc), for a list of instruments (with different instrument codes). For each input instrument code, only 1 RIC is returned (the primary RIC).

 

Table of contents

 

Get available field list for terms and conditions data - HTTP request

If you do not know what field lists are available, you can request a list of those available.

The report template type must be specified in the path. As we want terms and conditions data we set a value of TermsAndConditions. The preceding On Demand request tutorials show other possibilities.

See here for more information on report templates and corresponding field lists.

Note: for all requests we need a user token. This was retrieved in Tutorial 1.

URL:               

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/GetValidContentFieldTypes(ReportTemplateType=ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ReportTemplateTypes'TermsAndConditions')

Method:          GET

Headers:

Prefer: respond-async
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061

 

Get available field list for terms and conditions data - 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:

There are more than 1400 values in the response. Here is the beginning of the response:

{
  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ContentFieldTypes",
  "value": [
    {
      "Code": "TNC.144A Registered Flag",
      "Name": "144A Registered Flag",
      "Description": "Y/N flag indicating whether the issue is registered for the 144A rule",
      "FormatType": "Text",
      "FieldGroup": " "
    },
    {
      "Code": "TNC.AAOIFI Compliant Flag",
      "Name": "AAOIFI Compliant Flag",
      "Description": "Y/N flag indicating if an Islamic financial security is compliant with the standards of the Accounting and Auditing Organization for Islamic Financial Institutions (AAOIFI)",
      "FormatType": "Text",
      "FieldGroup": " "
    },
    {
      "Code": "TNC.ABI Life Scheme Classification",
      "Name": "ABI Life Scheme Classification",
      "Description": "Indicates the ABI Life Scheme classification for a fund",
      "FormatType": "Text",
      "FieldGroup": " "
    },
    {
      "Code": "TNC.ABI Pension Scheme Classification",
      "Name": "ABI Pension Scheme Classification",
      "Description": "Indicates the ABI Pension Classification for a fund",
      "FormatType": "Text",
      "FieldGroup": " "
    },
    {
      "Code": "TNC.Ability For Loss Beyond Capital",
      "Name": "Ability For Loss Beyond Capital",
      "Description": "Product carries the risk of loss beyond 100% of the invested capital. Only for MiFID II compliant funds",
      "FormatType": "Text",
      "FieldGroup": "MiFID"
    },

This goes on with all the other available fields. Here is the last part:

    {
      "Code": "TNC.Yield Type Description",
      "Name": "Yield Type Description",
      "Description": "Description of Yield Type code",
      "FormatType": "Text",
      "FieldGroup": "Tick History Reference"
    },
    {
      "Code": "TNC.Yield Value",
      "Name": "Yield Value",
      "Description": "Value of the yield based on the income distributions in the past 12 months, as calculated by Lipper, or yield provided by the fund manager",
      "FormatType": "Number",
      "FieldGroup": " "
    },
    {
      "Code": "TNC.ZPage",
      "Name": "ZPage",
      "Description": "Unique system-assigned four-digit alphanumeric identifier for Eurobonds",
      "FormatType": "Text",
      "FieldGroup": " "
    }
  ]
}

The result contains the field code, name, a description, field type (number, text, date) and group.  Use this to choose the field names you want. In the next step we will make a request for data, using some data fields we chose.

 

Get terms and conditions data - HTTP request

This is similar to previous tutorials, as it is also an On Demand extraction request.

The body of the request must mention it is an extraction request. It contains several parts:

  • The type of extraction: as we want composite data we set a value of TermsAndConditionsExtractionRequest. Preceding On Demand extraction tutorials show other possibilities.
  • The list of field names: these were determined in the first step of this tutorial.
  • The list of instrument identifiers, each one with its type. Below we define several instruments, using different identifier types.
  • For this request we do not set any conditions.

Note: for all requests we need to include a user token in the header of our request. This was retrieved in Tutorial 1.

URL:               

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractWithNotes

Method:          POST

Headers:

Prefer: respond-async
Content-Type: application/json
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061

Body:

{
    "ExtractionRequest": {
        "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TermsAndConditionsExtractionRequest",
        "ContentFieldNames": [
           "RIC", "CUSIP", "ISIN", "SEDOL", "Issuer OrgID", "Currency Code"
        ],
        "IdentifierList": {
            "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
            "InstrumentIdentifiers": [
                { "Identifier": "00209tab1", "IdentifierType": "Cusip" },
                { "Identifier": "IBM.N", "IdentifierType": "Ric" },
                { "Identifier": "US4592001014", "IdentifierType": "Isin" },
                { "Identifier": "B1YW440", "IdentifierType": "Sedol" }
            ]
        }
    }
}

 

Get terms and conditions data - HTTP response

Request accepted, no timeout

If the token is valid, and there is no timeout (these requests can take time as they generate very large data sets), the data will be delivered.

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#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
  "Contents": [
    {
      "IdentifierType": "Cusip",
      "Identifier": "00209TAB1",
      "RIC": "00209TAB1=RRPS",
      "CUSIP": "00209TAB1",
      "ISIN": "US00209TAB17",
      "SEDOL": "2166502",
      "Issuer OrgID": "172642",
      "Currency Code": "USD"
    },
    {
      "IdentifierType": "Ric",
      "Identifier": "IBM.N",
      "RIC": "IBM.N",
      "CUSIP": "459200101",
      "ISIN": "US4592001014",
      "SEDOL": "2005973",
      "Issuer OrgID": "18228",
      "Currency Code": "USD"
    },
    {
      "IdentifierType": "Isin",
      "Identifier": "US4592001014",
      "RIC": "IBM.N",
      "CUSIP": "459200101",
      "ISIN": "US4592001014",
      "SEDOL": "2005973",
      "Issuer OrgID": "18228",
      "Currency Code": "USD"
    },
    {
      "IdentifierType": "Sedol",
      "Identifier": "B1YW440",
      "RIC": "LP71000002",
      "CUSIP": null,
      "ISIN": "GB00B1YW4409",
      "SEDOL": "B1YW440",
      "Issuer OrgID": "100691344",
      "Currency Code": "GBp"
    }
  ],
  "Notes": [
    "Extraction Services Version 13.2.41189 (85522a4c8b22), Built Nov 11 2019 22:27:09\r\nUser has overridden estimates broker entitlements.\r\nProcessing started at 19112019 16:13:44.\r\nUser ID: 33314\r\nExtraction ID: 398262217\r\nSchedule: _OnD_0x06df5ed50de12ba5 (ID = 0x06df5ed513212ba5)\r\nInput List (4 items): _OnD_0x06df5ed50de12ba5 (ID = 06df5ed511812ba5) Created: 19112019 16:13:42 Last Modified: 19112019 16:13:43\r\nSchedule Time: 19112019 16:13:43\r\nReport Template (12 fields): _OnD_0x06df5ed50de12ba5 (ID = 0x06df5ed50e212ba5) Created: 19112019 16:13:42 Last Modified: 19112019 16:13:42\r\nProcessing completed successfully at 19112019 16:13:44, taking 0.506 Secs.\r\nExtraction finished at 19112019 15:13:44 UTC, with servers: x04E03, QSHC18 (0.1 secs), QSSHA1 (0.1 secs)\r\nUsage Summary for User 33314, Client 11122, Template Type Terms and Conditions\r\nBase Usage\r\n    Instrument              Instrument           Terms      Price\r\n  Count Type                Subtype            Source     Source\r\n------- ----------------------------------- ---------------------------- -------------- ----------------------------------------\r\n    1 Corporate               Investment Grade       N/A      N/A\r\n    2 Equities                             N/A      N/A\r\n    1 Mutual Funds                           Lipper     N/A\r\n-------\r\n    4 Total instruments charged.\r\n    0 Instruments with no reported data.\r\n=======\r\n    4 Instruments in the input list.\r\nWriting RIC maintenance report.\r\n",
    "Identifier,IdentType,Source,RIC,RecordDate,MaintType,OldValue,NewValue,Factor,FactorType\r\n"
  ]
}

 

Request accepted, but with a timeout

If the token is valid, but there was a timeout, this is the response we get:

Status:                        202 Accepted

Relevant headers:

Location: https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractResult(ExtractionId='0x05a6a7961d1b3036')

Body:

Response does not contain any data.

You will have to send another HTTP GET request to retrieve the result, using the location URL that was delivered in the HTTP 202 Response header.

 

Get terms and conditions data, subsequent request after a timeout - HTTP request

This is how we resend our request. Note the path, taken from the 202 response header:

URL:               

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractResult(ExtractionId='0x05a6a7961d1b3036')

Method:          GET

Headers:

Prefer: respond-async
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061

If the data is available, you will get the results. Otherwise you will have to try again later. The more data is requested, the longer it can take for it to be available.

 

Tutorial Group: 
REST API Tutorials