Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • DSS /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

avatar image
Question by rahul.deshmukh · Oct 15, 2020 at 07:31 AM · dss-rest-apidssdatascope-selectdatafunds

full holdings for a fund and ETF DSS Rest API request generates Http error code : 202

Hi All,

I have urgent query.

I am using below DSS Rest API refinitiv request for full holdings for a fund and sending 50 Identifier requests at a time. But since Monday this week we are getting error : Got http error code: 202: And at the end we are able to process and fetch response for only few Identifiers.

We are using daily job at 6am to provide the DSS Rest API request to refinitiv and fetch response.

When i tried to run the same java code and provide DSS Rest API request to refinitiv in the afternoon at 3pm then i am not facing any issue and we are able to fetch the response for most of the Identifiers.


This is critical issue for us. Can you please provide an information if the refinitiv DSS Rest API request has issues in the morning time for full holdings for a fund and ETFs? We did not face this issue before.


Below is the DSS Rest API request for full holdings for a fund. And i am facing the same issue for ETF also:

"ExtractionRequest": {
            "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.FundAllocationExtractionRequest",
            "ContentFieldNames": [
              "Security Description",
              "Allocation Asset Type",
              "Allocation Date",
              "Allocation Item",     
              "Allocation Percentage",      
              "Allocation ISIN",      
              "Market Value Currency",
              "Market Value Held"     
            ],
            "IdentifierList": {
              "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
              "InstrumentIdentifiers": [%s],
              "ValidationOptions": null,
              "UseUserPreferencesForValidationOptions": false
            },
            "Condition": {
              "FundAllocationTypes": [
                "Asset",
                "Currency",
                "FullHoldings",
                "IndustrySector",
                "InvestmentCountry",
                "TopTenHoldings"
              ]
            }
          }
        }
        """



People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Gurpreet · Oct 16, 2020 at 01:59 PM
I am already using below method as asynchronous request in my code. connection.setRequestProperty('Prefer', 'respond-async')

Get rid of this line to get a synchronous response (HTTP 200). Your application might have to wait a very long time for data, and intermediate network components like routers/proxies might drop your connection.

If you need to speak with DSS technical support team, please raise a ticket at MyRefinitiv and select appropriate product.

Comment

People who like this

0 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
rahul.deshmukh · Oct 16, 2020 at 02:06 PM 0
Share

@Gurpreet thanks i will try to remove the below line connection.setRequestProperty('Prefer', 'respond-async')

and check again if i get the same issue with (HTTP 202) and also communicate with technical support team in case any further issue.

avatar image
rahul.deshmukh · Oct 26, 2020 at 09:27 AM 0
Share

@Gurpreet i tried to remove connection.setRequestProperty('Prefer', 'respond-async') part from my code and now i dont see any issue with http error 202 thanks

avatar image
REFINITIV
Answer by Gurpreet · Oct 15, 2020 at 06:03 PM

Hi @rahul.deshmukh,

HTTP 202 is not an error but a status message. It means that server is processing your request.

You can use this Python code snippet as a starting point for your application (keep checking the response message until error or 200)

def checkStatus(url):
    hdrs = {
        "Authorization": "Token " + myToken,
        "Prefer": "respond-async, wait=60"
    };
    return sess.get(url, headers = hdrs);

# is it a 202 (in progress)
while (resp.status_code == 202):
    print("waiting...");
    # check if the response completed yet
    URL = resp.headers['Location'];
    resp = checkStatus(URL);

You can see that, this async behavior occurs because we specify respond-async in the request header. If this parameter was omitted, it will become a synchronous call, and your request will block until the data is fulfilled.

Comment

People who like this

0 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
rahul.deshmukh · Oct 16, 2020 at 07:24 AM 0
Share

Hi Gurpreet,

As i mentioned in question, we didn't faced this issue till last week while using the rest api which i have mentioned and since Monday morning this week where our job is scheduled at 6am daily, we are getting lot of http error :202. and we are missing lot of FUND_ISIN(Identifier) which has not been processed.


The strange part is i tried to run the java code in the afternoon using the same rest api and i didnt got this http error:202 and we are able to process most of the fund_isin(identifiers). But this seems to be not solution as we need this data in the morning.


We are using Java using rest api and not python. If you can please provide me change which i need to do in this rest api will be helpful. This is critical issue for us.

Thanks.

avatar image
rahul.deshmukh · Oct 16, 2020 at 07:59 AM 0
Share

Currently we have 3700 Identifiers and i am sending 50 Identifiers at once to resp api request...And to process all the 3700 Identifiers takes 1.5 hours.....If i reduce sending 20 Identifier at once to rest api request then it takes more thans 3 hours which is too much..

avatar image
REFINITIV
Answer by Gurpreet · Oct 16, 2020 at 01:27 PM

@rahul.deshmukh, Please read about asynchronous mechanism in the DSS documentation. What you are describing as an error, is a feature which web technologies use when long wait times are expected. Why your application has to wait at certain times, might be due to the load on the server, time of the day or other embargo conditions etc. Either way, if you are requesting async mechanism, then your application should be ready to handle async response.

See the DSS2OnDemandIntradayBarsTRTH.java example in the downloads section, on how to handle async communication.

Comment

People who like this

0 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
rahul.deshmukh · Oct 16, 2020 at 01:49 PM 0
Share

@Gurpreet I am already using below method as asynchronous request in my code.

As you said why we have to wait certain times because of load on server or may be due to other embargo conditions etc and i believe this is happening here and we would like to know the exact reason of this issue because we are not able to process all the Identifiers which is critical issue for us.

//Connection to the URL string https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractWithNotes
    private static HttpURLConnection connection(String urlSpec) {
        HttpURLConnection connection = new URL(urlSpec).openConnection() as HttpURLConnection

        connection.setRequestProperty('Prefer', 'respond-async')
        connection.setRequestProperty('Accept', 'application/json')

        connection.setRequestMethod("POST")
        connection.setRequestProperty("Content-Type", "application/json; utf-8")
        connection.setDoOutput(true)
        connection
    }

And then for generating authentication token:

HttpURLConnection connection = connection("https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractWithNotes")

connection.setRequestProperty('Authorization', "Token $authToken")




avatar image
rahul.deshmukh · Oct 16, 2020 at 01:51 PM 0
Share

I already mentioned the time(daily at 6am) on which we are trying to send request to dss rest api to refinitiv. Is it possible for you to find during this time if we have too much load on server or are there any other embargo conditions ? Or do you know any other further contacts with whom we can reach ?

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
14 People are following this question.

Related Questions

How can I find the "adjusted price history"?

Legal Entity OrgId for Fund

DSS Search: FundSearch using FundSubType

DSS API: Fund Search

Last DIvidend DSS with API

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges