I am seeing 202 Accepted with header value “status” => “InProgress” and not “200 OK”.

Request
Header:
'prefer' => 'respond-async',
'content-type' => 'application/json; odata=minimalmetadata',
'content-length' => 0,'authorization' => 'Token _cehY******'
Body:
{
"ExtractionRequest":
{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest",
"ContentFieldNames":[
"Trade - Price",
"Trade - Volume"
],
"IdentifierList":
{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers":[
{ "Identifier":"VOD.L",
"IdentifierType":"Ric"
},
{ "Identifier":"IBM.N",
"IdentifierType":"Ric"
}
],
"ValidationOptions":null,
"UseUserPreferencesForValidationOptions":false
},
"Condition":
{
"MessageTimeStampIn":"GmtUtc",
"ApplyCorrectionsAndCancellations":true,
"ReportDateRangeType":"Range",
"QueryStartDate":"2017-01-01T09:00:00.000",
"QueryEndDate":"2017-01-01T10:00:00.000",
"DisplaySourceRIC":false
}
}
}
Response
Code: 202 Accepted
Header:
'x-app-id' => 'Custom.RestApi',
'cache-control' => 'no-cache',
'set-cookie' => 'DSSAPI-COOKIE=R2817038826; path=/',
'date' => 'Thu, 08 Jun 2017 19:19:54 GMT',
'status' => 'InProgress',
'client-ssl-cert-issuer' => '/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4',
'client-ssl-cipher' => 'RC4-SHA',
'client-peer' => '192.165.219.152:443',
'client-date' => 'Thu, 08 Jun 2017 19:19:54 GMT',
'client-ssl-warning' => 'Peer certificate not verified',
'x-request-execution-correlation-id' => '528c84b5-da5f-42ad-9610-77d741818a07',
‘pragma' => 'no-cache',
'server' => 'Microsoft-IIS/7.5',
'client-ssl-socket-class' => 'IO::Socket::SSL',
‘client-response-num' => 1,
'location' => 'https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractRawResult(ExtractionId=\'0x05bfd3812aab3026\')',
'progress' => '',
'content-length' => '0',
'x-app-version' => '11.0.492.64',
'client-ssl-cert-subject' => '/C=US/ST=New York/L=New York/O=Thomson Reuters/CN=hosted.datascopeapi.reuters.com',
'expires' => '-1'
This response just continuously loops. I left it for 2 hours
yesterday with no difference.
Strangely, I ran the job about ten mins ago and it actually
returned something different:
Code: 200 OK
This seems to be the correct response. I just re-ran now and
back to the infinite loop. Any ideas why it does not return something every
time?
Best Answer
-
The behavior you see is normal. After using POST to submit an On Demand request, receiving a 202 Accepted means the request was accepted by the server, and is currently being processed. That is why the status is In Progress.
If you POST the same query again you are submitting a second instance of the query.
So, after using POST to submit a request, you will usually receive a 202 Accepted (I say usually, because if the request is very small it might actually complete and return a 200 if it takes less than 30 seconds, but this is a rare occurence). In the 202 header you also have an item called Location, which is an URL. Save it. The next step is to query that URL with a GET, to check the status of the extraction. The location URL looks like this:
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractRawResult(ExtractionId='0x058dcda3c29b5841')
The GET to the location URL will either return a 202 Accepted or a 200 OK. If you receive a 202 it means the extraction has not yet completed, you must wait, and then repeat the GET query to the location URL, until you receive a 200 OK. Once you receive a 200 OK, then extract the value of the JobId (it looks like this: 0x05a64ba76a4b3036) from the body of the response.
The final step, to retrieve the data, is a GET to a URL of this form:
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/RawExtractionResults('0x05a64ba76a4b3036')/$value
Note that this URL contains the JobId. The response will contain the data you initially requested.
The entire workflow is described in detail in the REST API Tutorial 3.
0
Answers
-
Christiaan Meihsl , Thank you for the response. But the client has mentioned he had Ieft it for 2 hours and he doesn't see any difference. So what is the expected time to see the message 202 Accepted changed to 200 Ok (What are the key factors for this time)?
0 -
Hi @Beera.Rajesh ,
As Christiaan has explained above, the approach should be:
1. Initiate the request
2. While the response is 202, keep checking periodically, as illustrated by Postman Tutorials "Check..." and in Java examples code
3. Once it's 200, proceed to retrieve.
Hope this helps
0 -
The request above is a small request. I just tested it to give you an idea of the execution time:
- 00:00 POST request
- 00:30 Receive 202
- 00:35 GET location URL
- 00:45 Response contains JibId
=> It took less than 1 minute.
Please double check that the customer is following the correct workflow, as described in my answer above.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 614 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 641 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 89 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛