For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted

How to get exchanges rates using instrumentation list name and report template name?

I have DSS user account and I have created one instrumentation list & EOD Pricing report template. I want to develop one api in my project which calls Thomson DSS Rest API to get the conversion rates for all the currencies & crosses mentioned in the instrumentation list (I have 161 currencies in instrumentation list). I don't want to create any schedules, don't want to use immediate extraction functionalities as I don't want any extracted file. I want response as list of all exchange rates. Please help me ASAP.

dss-rest-apidatascope-selectdssrics
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
11.3k 25 9 14

@gurukrishna.santosh.kumar.ippili

On the screenshot, the response status is 202 Accept which means that the request is accepted but the extracted data is not available within timeout interval (30 seconds by default). You will have to send another HTTP GET request to get status of the extraction, using the location URL that was delivered in the HTTP 202 Response header. Once the extraction is completed, the request to location URL will return extracted data.

In Postman, below is the sample of "Header" tab of the response.


1595297096201.png (32.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
11.3k 25 9 14

Hi @gurukrishna.santosh.kumar.ippili,

You can extract data using the On Demand extraction where extraction is created on the fly and extracted data can be received in JSON format. For more information about On Demand extraction, please see this guide.

Please follow the instructions in the On Demand End of Day Extraction tutorial.

Moreover, if you have an InstrumentList created on DSS server, you can also create On Demand extraction which uses existing instrument list as input identifier list.

Below is the sample of request.

POST https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractWithNotes
{
  "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.EndOfDayPricingExtractionRequest",
    "ContentFieldNames": [
      "Ask Price",
      "Bid Price",
      "High Price",
      "Low Price",
      "Trade Date",
      "Universal Close Price"
    ],
    "IdentifierList": {
      "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentListIdentifierList",
      "InstrumentListId": "0x05e64a4b0f5b2f96"
    },
    "Condition": null
  }
}

The Instrument List ID can be retrieved from the URL in the DSS GUI.


1595213384191.png (34.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi , Thanks for your response. I have tried the same request in postman but didn't get any response. Please find the attached snapshot.

Note: My instrumentation list contains 161 currencies.



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

@veerapath.rungruengrayubkul I have few questions: 1) Is there any chance to increase the timeout of the request (more than 30 secs) so that we no need to make another request?

2) Is the ExtractionId will be different every time or same?

3) Just to inform that we are calling from .Net. Can we create two lists each contains (80 curriences) to overcome timeout problem?


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
11.3k 25 9 14

Hi @gurukrishna.santosh.kumar.ippili,

Sorry. I have not seen your questions. Please see the answers below.

1) Is there any chance to increase the timeout of the request (more than 30 secs) so that we no need to make another request?

You can change the timeout value by specifying "wait" in the "Prefer" header of the ExtractionRequest message. Below is the sample of 120 seconds timeout. For more information, please see Key Mechanisms.

Prefer: respond-async, wait=120


2) Is the ExtractionId will be different every time or same?

The ExtractionId is unique identifier for each extraction, so it should be different for each extraction request.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @veerapath.rungruengrayubkul

Thanks for your response.

I have used the approach you suggested by taking the value in the location header and make get request.

Sometimes content property value is null. What is the reason? Any solution for this?

Upvotes

Hi @veerapath.rungruengrayubkul

Thanks for your response.

I have used the approach you suggested by taking the value in the location header and make get request. It is working as expected but sometimes content property value is null. What is the reason? Any solution for this?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @gurukrishna.santosh.kumar.ippili,

Could you share the request message and output which includes Notes information? There could be various reasons i.e. content not available, invalid instrurment).

Upvotes

Hi @veerapath.rungruengrayubkul

Thanks for your response.

I have attached the document which contains success and failure scenarios with request message and extraction notes.

Request:

{"ExtractionRequest":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.EndOfDayPricingExtractionRequest","ContentFieldNames":["Trade Date","Base Currency Code","Currency Code","Universal Close Price","FXIR Scaling Factor"],"IdentifierList":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentListIdentifierList","InstrumentListId":"0x06e4d6a06de133b0"},"Condition":null}}

Failed Case:

Regards,

Santosh Ippili


1596657245668.png (61.4 KiB)
1596657606690.png (115.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @veerapath.rungruengrayubkul

Please find the below more details:

Request parameters:

Success Case:


1596657821662.png (130.1 KiB)
1596657839744.png (115.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @veerapath.rungruengrayubkul

Please find the notes info in success case:

InstrumentListsNotesData_SuccessCase.txt


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
11.3k 25 9 14

Hi @gurukrishna.santosh.kumar.ippili,

I have seen the "The operation has timed out" exception error. It is possible that the HTTP request operation you use has its own timeout interval and the response time exceeded the timeout. You may try increasing the timeout value. This depends on the library you used for HTTP request. For example, WebRequest.Timeout property.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @veerapath.rungruengrayubkul

I have already increased my RestSharp request timeout value. Do we need to increase Prefer header timeout value? Currently I am using respond-async, wait=120 value.

Regards,

Santosh Ippili

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@gurukrishna.santosh.kumar.ippili,

Could you share the snippet code used for sending request and increasing timeout? I will try to replicate the issue.

Upvotes

Hi @veerapath.rungruengrayubkul

I am using RestSharp Library to make rest request to DSS.

Please find the methods in the attached file for your reference.

If the content property null in the initial request I am using location header value to make other request.


DSS InstrumentList Api Call.txt


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
11.3k 25 9 14

Hi @gurukrishna.santosh.kumar.ippili,

I have tried the code but cannot replicate the issue on my environment. The extraction is on large instrument list. Also, I have tried to change the_restRequest.Timeout to low value to verify scenario that response was received after request timeout. The application returns different error message; "The request timed-out", so the issue should not be related to the response time.

According to the code, it seems that your application is on Azure environment. It is possible that the issue is related to the environment. Could you please modify the application to test on other environment outside of Azure?

Also, you can enable logging on your application to get more information by modifying the app.config file as attached.App.zip


1597398038872.png (31.3 KiB)
app.zip (533 B)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @gurukrishna.santosh.kumar.ippili,

Yes the application is deployed in azure environment but when I test in my laptop also issue is replicated.

We have enabled azure application insights where we can see all the logs.

Can we connect once so that I can replicate the issue?

Regards,

Santosh Ippili

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @@veerapath.rungruengrayubkul,

Yes the application is deployed in azure environment but when I test in my laptop also issue is replicated.

We have enabled azure application insights where we can see all the logs.

Can we connect once so that I can replicate the issue?

Regards,

Santosh Ippili

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @veerapath.rungruengrayubkul,

Yes the application is deployed in azure environment but when I test in my laptop also issue is replicated.

We have enabled azure application insights where we can see all the logs.

Can we connect once so that I can replicate the issue?

Regards,

Santosh Ippili

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes

Hi @veerapath.rungruengrayubkul,

I have tested in postman for calling GET request to location header value. Below is the response.

Please find the attached snapshot. I am unable to attach my instrument list. Please let me know how to provide my instrument list

Postman_GetLocationHeaderResponseError.png


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @gurukrishna.santosh.kumar.ippili,

Please export the instrument list to a CSV file with the 'Export' button on the Instrument List Web GUI.

Also on the Postman call, please add the "Client-Session-Id" with unique identifier in the header of request message and provide "Request-Execution-Correlation-Id" header of the response message. For more information, please refer to the Diagnostic Header page.

1597628340992.png (15.0 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.